Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Javascript help

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
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
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Member card: see how many threads a member started
The member card now shows a Threads number, right after Posts. The member card is the box that opens when you point at a name. Profile...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back