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!

response.redirect/request.form problem

Status
Not open for further replies.

jacq

Technical User
Jan 3, 2001
38
0
0
GB
if i run this from page1.asp:
<form action=&quot;page2.asp&quot;>
and on page2.asp write:
request.form(&quot;field1&quot;)
i get the value from field1, page1.asp. OK

if i use:
<form action=<%call function()%>>
and the function is:
if
radio button = 1 then response.redirect(&quot;page2.asp&quot;)
else
response.redirect(page3.asp&quot;)
end if
the request.form(&quot;field1&quot;) on both page2.asp and page3.asp returns nothing.

please does anyone know what am i doing wrong?
 
Response.Redirect is a &quot;server side&quot; function. It therefore does not execute in the browser.

>> radio button = 1 then response.redirect(&quot;page2.asp&quot;)

the browser code to accomplish that would be

radio button = 1 then document.location = &quot;page2.asp&quot;

-pete
 
thanks, but isn't that javascript.
i have some information in a form that i want to pass to the url. when i tried to do it in javascript i could redirect the page, and retrieve the values from the form in the second page, but i couldn't mix the asp with the javascript code to pass the variable.
it seems i can do one thing or the other!!
 
>> thanks, but isn't that javascript.

Yes. Javscript is what is typically used in browser code.

>> but i couldn't mix the asp with the javascript code

yes, you cannot run &quot;server code&quot; in the &quot;browser&quot;. You can &quot;build browser code&quot; in your &quot;server code&quot;. That is the purpose of &quot;server code&quot;, to build the HTML page for the browser to render. The HTML can include javascript that executes in the browser, yes?

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top