Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Testsite</title>
- <script type="text/javascript">
- <!--
- if (top != self)
- {
- top.location = self.location;
- }
- function auswahl(javatest)
- {
- if(javatest == "2.")
- {
- document.getElementById('two').style.display='block';
- }
- else
- {
- document.getElementById('two').style.display='none';
- }
- }
- function hauptkategorie_auswahl(hauptkategorie)
- {
- unterkategorien_array=document.getElementsByName('unterkategorie');
- for(var i=0;i < unterkategorien_array.length;i++)
- {
- unterkategorien_array[i].style.display='none';
- unterkategorien_array[i].options[0].selected='selected';
- }
- document.getElementById(hauptkategorie).style.display='block';
- }
- function unterkategorien_auswahl(unterkategorie,unterkategorie_id)
- {
- document.getElementById('unterkategorie_id').value=unterkategorie_id;
- document.getElementById('unterkategorien_auswahl').innerHTML=unterkategorie;
- }
- // -->
- </script>
- </head>
- <body>
- <div id="content" align="center">
- <form method="post" action="">
- <table>
- <tr>
- <td>Drop-Down mit Javascript 1 :</td>
- <td style="text-align:left;">
- <select size="1" name="javatest" onchange="auswahl(this.options[this.selectedIndex].value);" style="float:left;">
- <option value="">2. anwaehlen!</option>
- <option value="1." >1.</option>
- <option value="2." >2.</option>
- <option value="3." >3.</option>
- </select>
- <div style="display:none;float:left;margin-left:5px;" id="two">
- <input type="text" name="two" size="7" maxlength="3" value=""/> Extraparameter
- </div>
- <br />
- </td>
- </tr>
- <tr>
- <td>Drop-Down mit Javascript 2 :</td>
- <td style="text-align:left;">
- <select size="1" name="hauptkategorie" onchange="hauptkategorie_auswahl(this.options[this.selectedIndex].value);" style="float:left;margin-right:10px;">
- <option value="">2. anwaehlen!</option>
- <option value="1" >
- 1 </option>
- <option value="2" >
- 2 </option>
- </select>
- <select size="1" name="unterkategorie" id="1" onchange="unterkategorien_auswahl(this.options[this.selectedIndex].title,this.options[this.selectedIndex].value);" style="display:none;">
- <option value="">Bitte wählen</option>
- <option value="1" title="1.1" >
- 1-1 </option>
- <option value="2" title="2.1" >
- 1-2 </option>
- <option value="1000161" title="3.1" >
- 1-3 </option>
- <option value="3" title="4.1" >
- 1-4 </option>
- <option value="4" title="5.1" >
- 1-5 </option>
- </select>
- <select size="1" name="unterkategorie" id="2" onchange="unterkategorien_auswahl(this.options[this.selectedIndex].title,this.options[this.selectedIndex].value);" style="display:none;">
- <option value="">Bitte wählen</option>
- <option value="97" title="0.2" >
- 2-1 </option>
- <option value="98" title="1.2" >
- 2-2 </option>
- <option value="1000162" title="2.2" >
- 2-3 </option>
- <option value="99" title="3.2" >
- 2-4 </option>
- <option value="100" title="4.2" >
- 2-5 </option>
- <option value="101" title="5.2" >
- </select>
- <div style="font-size:11px;padding-top:8px;clear:both;">
- </div>
- <input type="hidden" name="unterkategorie_id" id="unterkategorie_id" value="" />
- </td>
- </tr>
- </table>
- <br /><br />
- <input type="hidden" name="sent" value="1" />
- <input type="submit" value="absenden" />
- </form>
- <br />
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement