Two Forms 1 Page (1 Viewer)

stinej

Registered User.
Local time
Yesterday, 21:49
Joined
Feb 21, 2004
Messages
23
Hi.

I have two forms on one page and I'm having a problem holding the information in on of the forms textareas if the other form is posted.

My first form has a confirmation button for the user that they can click - clicking the button makes the for post back to itself and updates a record that the user has confirmed.

The second form has a textarea and a submit button that posts to another page and sends an email to a specified address.

The problem is that if the user has entered information into the second form's textarea - the one that sends the email - and before sending it they click the confirmation button on the first form, making the form post back to itself, any text they have entered in the textarea of the second form dissappears.

Is there a way to hold the value of the second form's textarea through the postback?

Thanks,
Josh
 

stinej

Registered User.
Local time
Yesterday, 21:49
Joined
Feb 21, 2004
Messages
23
Classic ASP. Thanks.
 

Kodo

"The Shoe"
Local time
Today, 00:49
Joined
Jan 20, 2004
Messages
707
do something like this at the top of your page
if request.form<>"" then

txtAreaText=request.form("txtAreaText")
'request.form("txtAreaText") references the name of the html text area.
end if

<textarea rows="5" columns="30"><%=txtAreaText%></textarea>

infact, do this for all your form fields.
You may even want to break the submissions up by passing a querystring value to determine what form was posted and then apply the above to those specific cases.
 

stinej

Registered User.
Local time
Yesterday, 21:49
Joined
Feb 21, 2004
Messages
23
Thanks for the reply.

I actually tried doing that from the beginning and it doesn't seem to be working.

The problem I think is that the second form - the one not posting back - can't assign the current value(s) of it's form fields (in my case only one text area) to a variable(s) as these values don't get posted anywhere??? Does this make sense?

Is there any work around?

Thanks,
Josh

PS My code below

If request.form("confirmed") = "yes" then
message = Request.Form("message")
Set oConn3 = Server.CreateObject("ADODB.Connection")
oConn3.Open connectstr
qry3="UPDATE tblDailyConfirm SET rStatus=1 WHERE confirmDate = convert(varchar, getDate(),101) AND employeeID = " & Request.form("employee")
oConn3.Execute qry3
Set oConn3 = nothing
Else
'Do nothing
End If

END CODE

Where the request form that passes the value for "confirmed" is not the form that holds the text area "message"
 

Users who are viewing this thread

Top Bottom