PDA

View Full Version : Response.Redirect two URLs


dude9er
09-09-2006, 04:29 AM
I'm trying to set a form that redirect the user to 2 url's based on their input.

The dependant form field is the email form field "ea"

Here is my code:

If Len(Request.Form("ea"))= 0 then
Response.Redirect "http://www.somesite.info/thankyou.html"
else
If Len(Request.Form("ea")) > 0 then
Response.Redirect "http://www.somesite.com/join.asp"
end if
end if

If "ea" is filled in the user is redirected and the value for that field is passed to an iFrame email form that autofills with the users email address:

<input name="ea" type="text" value="<%=request.querystring("email")%>" size="30" />

and receives this from the entrap field "ea":
<%
'extrap fields from URL on prev. page
ea = request.form("ea")
%>

For some reason when the field is blank the user is refered to the thank you page, and when the field is filled in the user is refered to the iFrame page but the text box is not entrapping the value.

Does anyone know what's wrong with this code? Is there a better way to do a double URL redirect?

Here is the reference page...
http://www.gift-a-stay.com/brochure_requests2.asp

Try testing the email field and watch the redirects, you see what works and what doesn't.

Thanks in advance everyone!!!

degsy
09-14-2006, 02:37 PM
The value is not passed to the Iframe page. It is passed to the Parent.
If you wanted it prepopulated you would have to grab it in the parent and use javascript to pass it.

Also , use ElseIf. It's neater.

If var = 0 Then
'Do This
ElseIf var = 1 Then
'Do This
Else
'Do This
End If