|
<- Choose a country
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="author" content="Roderick Divilbiss">
<meta name="copyright" content="© 2005-2010 Roderick Divilbiss">
<script language="javascript" type="text/javascript">
<!--
// The child selects
var noSelect = '<- Choose a country';
var usaSelect = '<select size="1" name="state"><option>State 1</option><option>State 2</option><option>State 3</option></select>';
var englandSelect = '<select size="1" name="state"><option>Shire 1</option><option>Shire 2</option><option>Shire 3</option><option>Shire 4</option><option>Shire 5</option><option>Shire 6</option></select>';
var mexicoSelect = '<select size="1" name="state"><option>Estado 1</option><option>Estado 2</option><option>Estado 3</option><option>Estado 4</option></select>';
// The changing function
function changeCountry(oSel) {
document.getElementById('childSelectDivide').innerHTML = eval(oSel[oSel.selectedIndex].value+'Select');
}
//-->
</script>
<title>Country Info</title>
</head>
<!--Shouldn't use tables for layout but it will do for this example-->
<table border="0" cellpadding="0" style="border-collapse: collapse" width="600">
<tr>
<td width="100">
<select name="country" onchange="changeCountry(this);" size="1">
<option value="no" selected>Select</option>
<option value="usa">USA</option>
<option value="england">England</option>
<option value="mexico">Mexico</option>
</select>
</td>
<td width="500" valign="top">
<div id="childSelectDivide"><- Choose a country</div>
</td>
</tr>
</table>
</body>
</html>
Date Validation Using JavaScript .
Cross-Browser Clipboard Copy .
Loading Images With Remote Scripting .
Why JavaScript In Hyperlinks Is Bad .
Change The Submit Button To Show Waiting For AJAX Response .
European Date Validation Using JavaScript .
Database Results To Client Side Array .
Reading Files With JavaScript .
AJAX For Plain Text And HTML .