Groups | Blog | Home
all groups > inetserver asp db > march 2007 >

inetserver asp db : Question about pull down menus on asp forms.



Brave
3/23/2007 10:48:23 AM
I have two questions about pulldown menus on forms.

1: Can I have the options of one pulldown menu be dictated by the
choice from another pulldown menu (example beow)?

2: Can I have a form be submitted when a choice is made in a pulldown
menu (example below)?

Example of question 1:

I have a form with two pulldown menus. The first one has two options.

1: LETTERS
2: NUMBERS

If I choose LETTERS, then the second menu offers the options A, B, and
C.
If I choose NUMBERS, the the second menu offers the options 1, 2, and
3.

Example of question 2:

Lets say (using the example above) I choose LETTERS from menu 1.
I then choose B from the menu 2. Once I choose the last option, I
would like to have the form automatically submit.

This functionality is new to me so I am not sure how to go about
creating the code. Any samples you can offer would be greatly
appreciated. Here is how I would make the form for the example above
but past that, I am lost.

<form method="POST" action="FormProcesspage.asp">

<p><select size="1" name="menu1">
<option>Letters</option>
<option>Numbers</option>
</select></p>

<p><select size="1" name="menu2">
<option>A or 1</option>(dictated by menu1)
<option>B or 2</option>(dictated by menu1)
<option>C or 3</option>(dictated by menu1)
</select></p>

<p><input type="submit" value="Submit"></p>

</form>

Thank you for taing the time to read my inquiry, and for any help (and
hopfully code samples) you can offer.
Jeff
3/31/2007 3:46:42 PM

[quoted text, click to view]

i am not an expert here, but i do know that this is more java script than
asp.

might have more response if you direct this to the proper NG.

Bam

Patrick
4/3/2007 1:22:26 AM
For the one dropdown causing the population of the other, you'll need to use
Javascript's onchange event in the dropdown box.
http://www.felgall.com/jstip22.htm

For the form post, you'll need the onchange event to run
document.FormName.submit();

[quoted text, click to view]

AddThis Social Bookmark Button