Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Field Manipulation 1

Status
Not open for further replies.

pwel

Programmer
Aug 18, 1999
79
GB
Hi,

Here's the scenario.

A user selects "NO" from (drop_down_1).
How do I then make the following (drop_down_2) have a specific value of "NONE" ??

Thanks in advance for any help with this!!

Paul W.
 
Insert this into a web page, try it out. Think that you'll like it. Is good if you don't have large arrays of info to add...just a few things for two or a couple more drop down boxes. Hope this helps...

========================================================



<html>
<head>

<script language=&quot;javascript&quot;>
<!--
function changeing(info) {
if(info == &quot;no&quot;){
if(yesIt.style.display == &quot;&quot;){
yesIt.style.display = &quot;none&quot;;
}
noIt.style.display = &quot;&quot;;
}
else{
if(noIt.style.display == &quot;&quot;){
noIt.style.display = &quot;none&quot;;
}
yesIt.style.display = &quot;&quot;;
}
}
// -->
</script>

</head>
<body>

<BR>
<form name='myForm' method='post' action='page2.asp'>
<DIV ID='main' style='position:absolute; left:40; top:40;'>
<select name='drop1' onChange='changeing(document.myForm.drop1.value)'>
<option value=''></option>
<option value='no'>No</option>
<option value='yes'>Yes</option>
</select>
</DIV>

<DIV ID='noIt' style='position:absolute; left:40; top:70; display:none;'>
<select name='drop2'>
<OPTION value=''>None<option>
</select>
</DIV>

<DIV ID='yesIt' style='position:absolute; left:40; top:70; display:none;'>
<select name='drop3'>
<OPTION value=''></OPTION>
<OPTION value=1>One</OPTION>
<OPTION value=2>Two</OPTION>
</select>
</DIV>
</form>



</body>
</html>


 
Thanks Ovatvvon,

That is a great help.

Paul W.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top