NameSilo

Javascript help

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
heeloo?
 
0
Close
it should work, but dont take my word for it
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back