Connecting Tech Pros Worldwide Forums | Help | Site Map

urgent code required simple selection list validation

Newbie
 
Join Date: Feb 2009
Posts: 27
#1: Mar 18 '09
hi experts
Expand|Select|Wrap|Line Numbers
  1. <head>
  2. <script type="text/javascript">
  3. </script>
  4.   </head>
  5. <body>
  6. <form>
  7. <select name="team" id="mylist" >
  8. <option></option>
  9. <option>north</option>
  10. <option>south</option>
  11. <option>east</option>
  12. <option>west</option>
  13. </select>
  14.  
  15. <select name="assignedto" id="mylist1" >
  16.     <option></option>
  17.     <option>rose</option>
  18.     <option>lily</option>
  19.     <option>lotus</option>
  20.     <option>basil</option>
  21.     <option>iris</option>
  22.     <option>champa</option>
  23.     <option>orchid</option>
  24.     <option>sonki</option>
  25.     </select>
  26. </form>
  27. </body>
  28. </html>
if the team north is selected from the listbox(mylist) i want only rose and lily to be populated in the second listbox ie(mylist1) and if south is selected lotus and basil should only be populated.

kindly somebody help me out in this code,it can be a javascript or php.
i have not written any function inside the javascript

TheServant's Avatar
Expert
 
Join Date: Feb 2008
Location: Australia
Posts: 914
#2: Mar 19 '09

re: urgent code required simple selection list validation


As-is, PHP will not help because by the time the user has access to the page and can choose a team, the page is already sent and is out of the realm of PHP and into Javascript territory. Have a go making a javascript function to do that or post the question in the javascript forum... Or wait for a moderator to move this to the javascript forum.
Reply