will this javascript work, what i'm trying to do is change a list depending on what job the user selects:
Code:
<form name="form1" method="post" action="register2.php">
<label><span class="Style4">Your Job:</span>
<select name="jobgroup" id="jobgroup" onSelect="JobTypeChange(this.form)">
<option value="MSeaman">Merchant Seaman</option>
<option value="Inet">Internet</option>
<option value="Office">Office Worker</option>
<option value="Education">Education</option>
</select>
<script language="javascript">
function JobTypeChange(form){
var Item;
Item = form.jobgroup.selectedIndex;
var Result;
Result = form.jobgroup.options[Item].text;
if(Result == "MSeaman"){
document.write("<select name='job' id='job' height='5'>
<option value='DPO'>DPO</option>
</select>");
}else if(Result == "Inet"){
document.write("<select name='job' id='job' height='5'>
<option value='Webmaster'>Webmaster</option>
</select>");
}else if(Result == "Ofice"){
document.write("<select name='job' id='job' height='5'>
<option value='Clerical'>Clerical</option>
</select>");
}else if(Result == "Education"){
document.write("<select name='job' id='job' height='5'>
<option value='Teacher'>Teacher</option>
</select>");
}
}
</script>
</label>
<br>
<label>
<input type="submit" name="Submit" value="Submit">
</label>
</form>





