Version compl�te: jsB@nk » Form » Dropdown » ShowDivId
URL: https://www.javascriptbank.com/showdivid.html
Une fonction de dynamique forme compositions à partir d'une option Sélectionner.
Version compl�te: jsB@nk » Form » Dropdown » ShowDivId
URL: https://www.javascriptbank.com/showdivid.html
<SCRIPT>//set last shown pointer to nonevar kar = 0function ShowDivId(SelId, DivId)<!-- Another small but powerful function by Ira --><!-- Original Programmed by Ira Sterbakov - [email protected] 9/5/04 --><!-- May be freely used and modified - email notification would be nice -->{num = document.getElementById(SelId).value if( kar > 0){//clear last shown//get divisionvar DivId2 = DivId + kar;//change display to nonedocument.getElementById(DivId2).style.display = 'none';kar = 0}if( num > 0){//get divisionvar DivId2 = DivId + num;//change display to blockdocument.getElementById(DivId2).style.display = 'block';kar=num}}</SCRIPT><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<FORM action=sendpick.php method=post>Static part of form: <INPUT size=40 name=Silly><BR><BR>Select which catagory: <SELECT id=catItems onchange="javascript: ShowDivId('catItems','divSubcat');"> <OPTION value=0 selected>catagory<OPTION value=1>1<OPTION value=2>2<OPTION value=3>3</OPTION></SELECT><BR><BR>Dynamic part of Form: <DIV id=divSubcat1 style="DISPLAY: none"><BR><B>Choose type of Item 1:</B><BR><BR><INPUT type=radio value=red1 name=Subcat1>Red<BR><INPUT type=radio value=white name=Subcat1>White<BR><INPUT type=radio value=yellow name=Subcat1>Yellow<BR><FONT color=green>Title: <INPUT type="text' value=" items1 size="20"?></FONT><BR></DIV><DIV id=divSubcat2 style="DISPLAY: none"><BR><B>Choose type of Item 2:</B><BR><BR><SELECT name=Subcat2> <OPTION selected value-?red2?>Red<OPTION value=white>White<OPTION value=yellow>Yellow</OPTION></SELECT><BR></DIV><DIV id=divSubcat3 style="DISPLAY: none"><BR><B>Choose type of Item 3:</B><BR><BR><INPUT type=radio value=red3 name=Subcat3>Red<BR><INPUT type=radio value=white name=Subcat3>White<BR><INPUT type=radio value=yellow name=Subcat3>Yellow<BR></DIV><BR><BR>More Static parts<BR><BR><INPUT type=submit value="Send in now"> </FORM><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->