Click to See Complete Forum and Search --> : HELP using Session variables one form to another
Chamark
12-11-2006, 03:21 PM
The user is filling out a form and get half way finished when he/she checks a checkbox field and another form pops up to be filled out with some of the same information from the main form. Keep in mind that the main form has not been submitted yet.
Would this be a time to use Session variables to pass field variables from one form to another or can this be done at all? How can I store the field values from main form to use in the popup form? Need direction. Thanks in advance for your help!! :confused:
so_is_this
12-11-2006, 06:48 PM
What drives the checkbox field to cause a popup window to be shown?
Chamark
12-11-2006, 07:59 PM
OnClick... when the user checks the box a window opens with a form that has some fields that I would like to auto-populate with information that would come from fields that have already been filled in the first form.
russell
12-11-2006, 08:10 PM
can't get the first form values into session until that form is submitted. either submit the form and then store values in session, or can use javascript to populate popup form. maybe best to have popup form a regular web page, say, the action of the first form.
definitely bad practice to make em fill out same info twice, so u r on the right track
Chamark
12-11-2006, 10:23 PM
If I set the session i.e. <%Session("whatever") = "whatever"%> I can pass that to the second form. I need to be able to replace the "whatever" with what the user typed in the field of form one. Help please
russell
12-11-2006, 10:31 PM
why not like this and forget the popup
-- page1
<form method=post action="page2.asp">
<input name=whatever type=text size=32 maxlen=32>
<input type=submit>
</form>
-- page 2
<%
Dim whatever
whatever = Request.Form("whatever")
'Session("whatever") = whatever
%>
<form>
<input name=whatever2 value="<%=whatever%>">
</form>
Chamark
12-12-2006, 05:33 AM
That would work, but this is a conditional checkbox that "onClick" brings up the 2nd form, so the first form does not get sent to the server prior to the 2nd form gettting executed
russell
12-12-2006, 11:19 AM
then you'll need to use JavaScript to send form values from main form to popup