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

passing data from one form to another

Status
Not open for further replies.

glendacom

MIS
Oct 23, 2002
36
0
0
US
i have an ASP file with two forms. The first form has fields that can be changed by the user and a submit button to process those changes to the database. The second form only has a submit button and some hidden fields. I have a need to set one of those hidden fields to a value from one of the fields in the first form even if the user has not submitted the first form. Can this be done?

I apologize if this has been answered before ... does anyone know when the search engine will be back up?
 
If they haven't submitted the first form, then there is no value from the first form...

What you can do is check the value of the form field, if it is not null then put it into your input:
<input type=&quot;hidden&quot; name=&quot;whatever&quot; value=&quot;[COLOR=#80000]<%=Request.Form(&quot;NameOfInputFromPage1&quot;)%>&quot;>[/color]

If the input from the previous page is null then they most likely did not submit that page. If you were getting the original value from the database then you will need to query the database in order to get the value to put in the form input.

Hope this helps,
-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
well, that's my problem ... they haven't submitted the first form yet. the form fields were loaded from the database and I can get those again for form2 but they may or may not have entered changes and I would like to be able to capture those changes for form2 even if form1 has not been submitted - oh well too bad.

Thanks for the reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top