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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple problem passing variables with forms

Status
Not open for further replies.

damann

Technical User
Jul 19, 2000
114
US
I have this simple problem where I have a dynamic list menu and when a user selects a value from the list menu the "id" of that value is passed on to another page where the all the field values of that "id" is displayed unto the page.

Here is the form from page 1 where the user is asked to select a value from the list menu:

<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;EditEvents.asp?ID=<%=objRS.Fields(&quot;ID&quot;)%>&quot;>


Now if you look at the action of that form, you'll see where my problem is. When the page is loaded it gets the value of the initially selected value and passes it on all the time. So on page 2 I always get the same value being passed on. How do I fix this, so that the value the user selected is passed on and not the initially selected value? The only way I see is if I call page one again and then redirect to the second page where the selected value will then be passes on, but there has got to be a simplier way of doing this. Please let me know...
 
Name your listbox &quot;ID&quot; and everything should work.
Code:
<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;EditEvents.asp?&quot;>
<select name=&quot;ID&quot;>
  <% blah, blah, fill in listbox contents %>
</select>
<input type=&quot;submit&quot;>
</form>
Now the item &quot;ID&quot; will be available in the Request object.

Wushutwist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top