<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <style type="text/css"> <!-- #q0 { display: block; } #q1,#q2,#q3,#q4 { display: none; } --> </style> <script type="text/javascript"> <!-- function next(co) { var ile = document.getElementById("wybor").options.length; for(var i=1; i<=ile; i++) { var ktora = "q"+i; if(ktora == co) { document.getElementById(ktora).style.display = "block"; }else if(ktora != co){ document.getElementById(ktora).style.display = "none"; } } } --> </script> </head> <body> <p> <select name="wybor" class="textbox" id="wybor" onChange="next(this.value);"> </select> <div id="q1"> <select class="textbox" name="q1"> </select> </div> <div id="q2"> <select class="textbox" name="q2"> </select> </div> <div id="q3"> <select class="textbox" name="q3"> </select> </div> <div id="q4"> <select class="textbox" name="q4"> </select> </div> <br /> ID: <input type="text" maxlength="20" name="tu_wpisz" id="wu_wpisz" /> </p> </body> </html>
Otóż pisze taki skrypt i teraz chcę ze gdy np. wybiorę Trzecia>6 to w polu ID (tu_wpisz) pokaże mi się automatycznie wartość 36 proszę o pomoc jak to załatwić w łatwy sposób.