[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 10-31-2005, 04:33 AM   #1 (permalink)
Barru.
 
Barrucadu's Avatar
 
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,731
78.50 NP$ (Donate)

Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold


Javascript help

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>
Barrucadu is offline  
Old 10-31-2005, 08:53 AM   #2 (permalink)
Barru.
 
Barrucadu's Avatar
 
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,731
78.50 NP$ (Donate)

Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold


heeloo?
Barrucadu is offline  
Old 10-31-2005, 07:57 PM   #3 (permalink)
Senior Member
 
commes's Avatar
 
Join Date: May 2005
Location: Regina, Sask, Canada
Posts: 1,323
36.55 NP$ (Donate)

commes is just really nicecommes is just really nicecommes is just really nicecommes is just really nice


it should work, but dont take my word for it
commes is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading different images depending on the browser (JavaScript) Nevsan Programming 3 04-04-2004 09:36 AM
How I fill javascript array with php variables? wiedzim CODE 0 03-31-2004 02:45 AM
javascript vs asp.net validation tzigone Web Design Discussion 0 01-21-2004 12:37 AM
Javascript Functions: Your needs. Mp)Tarh Web Design Discussion 1 11-15-2003 05:50 AM
why is javascript causing sound problems? Rhino1616 Programming 0 04-28-2003 10:20 AM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 05:10 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85