Advertisement
Guest User

Untitled

a guest
Apr 21st, 2014
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
  2. <table>
  3. <tr valign="baseline">
  4. <td nowrap="nowrap" align="right">Price:</td>
  5. <td><label>
  6. <select name="price" id="price">
  7. <option value="price1">price1</option>
  8. <option value="price2">price2</option>
  9. </select>
  10. </label></td>
  11. </tr>
  12. <tr valign="baseline">
  13. <td nowrap="nowrap" align="right">Course:</td>
  14. <td><label>
  15. <select name="course" id="course">
  16. <option value="course1">course1</option>
  17. <option value="course2">course2</option>
  18. </select>
  19. </label></td>
  20. </tr>
  21. </table>
  22. </form>
  23.  
  24. var pr = document.getElementById("price");
  25. var co = document.getElementById("course");
  26.  
  27. pr.onchange = function() {
  28. if(this.value == "price1")
  29. {
  30. co.selectedIndex = 0;
  31. }
  32. if(this.value == "price2")
  33. {
  34. co.selectedIndex = 1;
  35. }
  36. }
  37.  
  38. co.onchange = function() {
  39. if(this.value == "course1")
  40. {
  41. pr.selectedIndex = 0;
  42. }
  43. if(this.value == "course2")
  44. {
  45. pr.selectedIndex = 1;
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement