Advertisement
Guest User

Untitled

a guest
Oct 30th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.41 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Testsite</title>
  5.  
  6. <script type="text/javascript">
  7. <!--
  8. if (top != self)
  9. {
  10. top.location = self.location;
  11. }
  12.  
  13. function auswahl(javatest)
  14. {
  15. if(javatest == "2.")
  16. {
  17. document.getElementById('two').style.display='block';
  18. }
  19. else
  20. {
  21. document.getElementById('two').style.display='none';
  22. }
  23. }
  24.  
  25. function hauptkategorie_auswahl(hauptkategorie)
  26. {
  27. unterkategorien_array=document.getElementsByName('unterkategorie');
  28. for(var i=0;i < unterkategorien_array.length;i++)
  29. {
  30. unterkategorien_array[i].style.display='none';
  31. unterkategorien_array[i].options[0].selected='selected';
  32. }
  33.  
  34. document.getElementById(hauptkategorie).style.display='block';
  35. }
  36.  
  37. function unterkategorien_auswahl(unterkategorie,unterkategorie_id)
  38. {
  39. document.getElementById('unterkategorie_id').value=unterkategorie_id;
  40. document.getElementById('unterkategorien_auswahl').innerHTML=unterkategorie;
  41. }
  42.  
  43.  
  44. // -->
  45. </script>
  46. </head>
  47. <body>
  48. <div id="content" align="center">
  49. <form method="post" action="">
  50. <table>
  51. <tr>
  52. <td>Drop-Down mit Javascript 1 :</td>
  53. <td style="text-align:left;">
  54. <select size="1" name="javatest" onchange="auswahl(this.options[this.selectedIndex].value);" style="float:left;">
  55. <option value="">2. anwaehlen!</option>
  56. <option value="1." >1.</option>
  57. <option value="2." >2.</option>
  58. <option value="3." >3.</option>
  59. </select>
  60. <div style="display:none;float:left;margin-left:5px;" id="two">
  61. <input type="text" name="two" size="7" maxlength="3" value=""/> Extraparameter
  62. </div>
  63. <br />
  64. </td>
  65. </tr>
  66. <tr>
  67. <td>Drop-Down mit Javascript 2 :</td>
  68. <td style="text-align:left;">
  69. <select size="1" name="hauptkategorie" onchange="hauptkategorie_auswahl(this.options[this.selectedIndex].value);" style="float:left;margin-right:10px;">
  70. <option value="">2. anwaehlen!</option>
  71. <option value="1" >
  72. 1 </option>
  73. <option value="2" >
  74. 2 </option>
  75. </select>
  76.  
  77. <select size="1" name="unterkategorie" id="1" onchange="unterkategorien_auswahl(this.options[this.selectedIndex].title,this.options[this.selectedIndex].value);" style="display:none;">
  78. <option value="">Bitte w&auml;hlen</option>
  79. <option value="1" title="1.1" >
  80. 1-1 </option>
  81. <option value="2" title="2.1" >
  82. 1-2 </option>
  83. <option value="1000161" title="3.1" >
  84. 1-3 </option>
  85. <option value="3" title="4.1" >
  86. 1-4 </option>
  87. <option value="4" title="5.1" >
  88. 1-5 </option>
  89. </select>
  90. <select size="1" name="unterkategorie" id="2" onchange="unterkategorien_auswahl(this.options[this.selectedIndex].title,this.options[this.selectedIndex].value);" style="display:none;">
  91. <option value="">Bitte w&auml;hlen</option>
  92. <option value="97" title="0.2" >
  93. 2-1 </option>
  94. <option value="98" title="1.2" >
  95. 2-2 </option>
  96. <option value="1000162" title="2.2" >
  97. 2-3 </option>
  98. <option value="99" title="3.2" >
  99. 2-4 </option>
  100. <option value="100" title="4.2" >
  101. 2-5 </option>
  102. <option value="101" title="5.2" >
  103. </select>
  104. <div style="font-size:11px;padding-top:8px;clear:both;">
  105. </div>
  106.  
  107. <input type="hidden" name="unterkategorie_id" id="unterkategorie_id" value="" />
  108. </td>
  109. </tr>
  110. </table>
  111. <br /><br />
  112. <input type="hidden" name="sent" value="1" />
  113. <input type="submit" value="absenden" />
  114. </form>
  115. <br />
  116. </div>
  117. </body>
  118. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement