so heres my page:
[code=html]<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”content-type” content=”text/html; charset=utf-8″ />
<title>LoraxAlliance</title>
<link href=”includes/style.css” rel=”stylesheet” type=”text/css” />
<script type=”text/javascript” src=”http://www.loraxalliance.org/includes/coutry.js”></script></head>
<body>
<table id=”page”>
<tr>
<td id=”header” colspan=”5″></td>
</tr>
<tr>
<td id=”button”>
<a href=”http://www.loraxalliance.org/”><img src=”http://www.loraxalliance.org/images/Home.gif”></a>
</td>
<td id=”button”>
<a href=”http://www.loraxalliance.org/clubs.php”><img src=”http://www.loraxalliance.org/images/Clubs.gif”></a>
</td>
<td id=”button”>
<a href=”http://www.loraxalliance.org/projects.php”><img src=”http://www.loraxalliance.org/images/Projects.gif”></a>
</td>
<td id=”button”>
<a href=”http://www.loraxalliance.org/forums.php”><img src=”http://www.loraxalliance.org/images/Forums.gif”></a>
</td>
<td id=”button”>
<a href=”http://www.loraxalliance.org/login.php”><img src=”http://www.loraxalliance.org/images/Login.gif”></a>
</td>
</tr>
<tr id=”main”>
<td id=”menu”></td>
<td id=”content” colspan=”3″>
<form method=”post” id=”form”><br />
<table align=”center” id=”ftable”>
<tr>
<td>First Name*:</td>
<td><input type=”text” name=”first” /></td>
</tr>
<tr>
<td>Last Name*:</td>
<td><input type=”text” name=”last” /></td>
</tr>
<tr>
<td>Make name public:</td>
<td><input type=”checkbox” name=”pname” checked></td>
</tr>
<tr>
<td>Username*:</td>
<td><input type=”text” name=”user” /></td>
</tr>
<tr>
<td>Password*:</td>
<td><input type=”password” name=”password” /></td>
</tr>
<tr>
<td>Confirm Password*:</td>
<td><input type=”password” name=”password2″ ></td>
</tr>
<tr>
<td>Email*:</td>
<td><input type=”text” name=”email” ></td>
</tr>
<tr>
<td>Confirm email*:</td>
<td><input type=”text” name=”email2″ ></td>
</tr>
<tr>
<td>Make email public:</td>
<td><input type=”checkbox” name=”pemail” checked></td>
</tr>
<tr>
<td>School*:</td>
<td><input type=”text” name=”school” ></td>
</tr>
<tr>
<td>Make school public:</td>
<td><input type=”checkbox” name=”pschool” checked</td>
</tr>
<tr id=”loc”>
<td id=”coun”>
<select id=”countrySelect” name=”country” onchange=”populateState()”></select>
</td>
<td id=”sta”>
<select id=”stateSelect” name=”state”></select>
<script type=”text/javascript”>initCountry(‘US’); </script>
</td>
</tr>
<tr>
<td>Please write a little about yourself.</td>
<td><textarea cols=”30″ rows=”5″ name=”about”></textarea></td>
</tr>
<tr>
<td>Enter the string below exactly as you see it.<br>(there are no ones or zeros.)</td>
</tr>
<tr>
<td><img src=”http://www.loraxalliance.org/includes/val.php” border=0></td>
<td><input type=”text” name=”conf”></td>
</tr>
<tr>
<td colspan=”2″><center><input type=”submit” value=”Register” name=”reg”/></center></td>
</tr>
</table>
</form>
</td>
<td id=”posts”></td>
</tr>
<tr>
<td id=”footer” colspan=”5″>Copyright 2008</td>
</tr>
</table>
</body>
</html>
and here is the javascript at “
[CODE]
function TrimString(sInString) {
if ( sInString ) {
sInString = sInString.replace( /^s+/g, “” );// strip leading
return sInString.replace( /s+$/g, “” );// strip trailing
}
}
// Populates the country selected with the counties from the country list
function populateCountry(defaultCountry) {
if ( postCountry != ” ) {
defaultCountry = postCountry;
}
var countryLineArray = country.split(‘|’); // Split into lines
var selObj = document.getElementById(‘countrySelect’);
selObj.options[0] = new Option(‘Select Country’,”);
selObj.selectedIndex = 0;
for (var loop = 0; loop < countryLineArray.length; loop++) {
lineArray = countryLineArray[loop].split(‘:’);
countryCode = TrimString(lineArray[0]);
countryName = TrimString(lineArray[1]);
if ( countryCode != ” ) {
selObj.options[loop + 1] = new Option(countryName, countryCode);
}
if ( defaultCountry == countryCode ) {
selObj.selectedIndex = loop + 1;
}
}
}
function populateState() {
var selObj = document.getElementById(‘stateSelect’);
var foundState = false;
// Empty options just in case new drop down is shorter
if ( selObj.type == ‘select-one’ ) {
for (var i = 0; i < selObj.options.length; i++) {
selObj.options[i] = null;
}
selObj.options.length=null;
selObj.options[0] = new Option(‘Select State’,”);
selObj.selectedIndex = 0;
}
// Populate the drop down with states from the selected country
var stateLineArray = state.split(“|”); // Split into lines
var optionCntr = 1;
for (var loop = 0; loop < stateLineArray.length; loop++) {
lineArray = stateLineArray[loop].split(“:”);
countryCode = TrimString(lineArray[0]);
stateCode = TrimString(lineArray[1]);
stateName = TrimString(lineArray[2]);
if (document.getElementById(‘countrySelect’).value == countryCode && countryCode != ” ) {
// If it’s a input element, change it to a select
if ( selObj.type == ‘text’ ) {
parentObj = document.getElementById(‘stateSelect’).parentNode;
parentObj.removeChild(selObj);
var inputSel = document.createElement(“SELECT”);
inputSel.setAttribute(“name”,”state”);
inputSel.setAttribute(“id”,”stateSelect”);
parentObj.appendChild(inputSel) ;
selObj = document.getElementById(‘stateSelect’);
selObj.options[0] = new Option(‘Select State’,”);
selObj.selectedIndex = 0;
}
if ( stateCode != ” ) {
selObj.options[optionCntr] = new Option(stateName, stateCode);
}
// See if it’s selected from a previous post
if ( stateCode == postState && countryCode == postCountry ) {
selObj.selectedIndex = optionCntr;
}
foundState = true;
optionCntr++
}
}
// If the country has no states, change the select to a text box
if ( ! foundState ) {
parentObj = document.getElementById(‘stateSelect’).parentNode;
parentObj.removeChild(selObj);
// Create the Input Field
var inputEl = document.createElement(“INPUT”);
inputEl.setAttribute(“id”, “stateSelect”);
inputEl.setAttribute(“type”, “text”);
inputEl.setAttribute(“name”, “state”);
inputEl.setAttribute(“size”, 20);
inputEl.setAttribute(“value”, postState);
parentObj.appendChild(inputEl) ;
}
}
function initCountry(country) {
populateCountry(country);
populateState();
}
but the selects are blank.