Dynadot โ€” .com Registration $8.99

Javascript help

Spaceship Spaceship
Watch

Barrucadu

Established Member
Impact
64
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>
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
heeloo?
 
0
•••
it should work, but dont take my word for it
 
0
•••
Unstoppable Domains
Domain Recover
DomainEasy โ€” Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back