need help with javascript toggle menu
Posted: Fri May 06, 2005 10:42 am
i am working on a dropdown menu where if you select an option, a form appears below.
This is what i'm working on....
i have a dropdown menu where the user will be able to select which option they would like to purchase and once they select it another table below appears with the appropriate for m for that section.
i've been working with it and now how can i get it to come up as one field at a time so that only one field is showing. the way it looks now, when you choose one, then choose another, it just adds fields to the page, how can i get it to add one field at a time like if you choose one option, one field shows up, you choose another option, the other field shows up, without the last field adding to it?
if you want to take a look at the page, here's the address:
http://www.mynetmarketingcenter.com/eblasts/
the drop down menu is at the bottom of the page
any help would be appreciated, thanks
here is the code i'm using:
This is what i'm working on....
i have a dropdown menu where the user will be able to select which option they would like to purchase and once they select it another table below appears with the appropriate for m for that section.
i've been working with it and now how can i get it to come up as one field at a time so that only one field is showing. the way it looks now, when you choose one, then choose another, it just adds fields to the page, how can i get it to add one field at a time like if you choose one option, one field shows up, you choose another option, the other field shows up, without the last field adding to it?
if you want to take a look at the page, here's the address:
http://www.mynetmarketingcenter.com/eblasts/
the drop down menu is at the bottom of the page
any help would be appreciated, thanks
here is the code i'm using:
Code: Select all
<html>
<head>
<title>Display <input> OnClick</title>
<script type="e;text/javascript"e;>
function toggle(elementId)
{
if(elementId == 0)
{
return;
}
var obj = document.getElementById(elementId);
obj.style.display = (obj.style.display == "e;none"e;) ? "e;block"e; : "e;none"e;;
}
</script>
</head>
<body>
<form action="e;_SELF"e; method="e;post"e; name="e;send"e; enctype="e;multipart/form-data"e;>
<select name="e;menu"e; onchange="e;toggle(this.optionsїthis.selectedIndex].value)"e;>
<option value="e;0"e; selected="e;selected"e;>Select...</option>
<option value="e;1"e;>Solo 1-Line Ad</option>
<option value="e;2"e;>Solo Classified Ad</option>
<option value="e;3"e;>Solo Mini-Mailer</option>
<option value="e;4"e;>Solo Medium Mail Blaster</option>
<option value="e;5"e;>Solo Large Mail PRO-Blaster</option>
<option value="e;6"e;>Solo MASSIVE Mail PROPLUS-Blaster</option>
</select>
<!-- A <div> FOR EACH <option> -->
<div id="e;1"e; style="e;display: none;"e;><input type="e;text"e; name="e;text1"e; value="e;Solo 1-Line Ad"e; /></div>
<div id="e;2"e; style="e;display: none;"e;><input type="e;text"e; name="e;text2"e; value="e;Solo Classified Ad"e; /></div>
<div id="e;3"e; style="e;display: none;"e;><input type="e;text"e; name="e;text3"e; value="e;Solo Mini-Mailer"e; /></div>
<div id="e;4"e; style="e;display: none;"e;><input type="e;text"e; name="e;text4"e; value="e;Solo Medium Mail Blaster"e; /></div>
<div id="e;5"e; style="e;display: none;"e;><input type="e;text"e; name="e;text5"e; value="e;Solo Large Mail PRO-Blaster"e; /></div>
<div id="e;6"e; style="e;display: none;"e;><input type="e;text"e; name="e;text6"e; value="e;Solo MASSIVE Mail PROPLUS-Blaster"e; /></div>
</form>
</body>
</html>