Browser redirect to new window based on form data?

Results 1 to 2 of 2

Thread: Browser redirect to new window based on form data?

  1. #1
    Ian Thomas Guest

    Default Browser redirect to new window based on form data?

    Greetings all,<BR><BR>I posted this same thing over in ASP Q&A, but I got to thinking there may be an HTML answer to my problem, thus I repost here :)<BR><BR>Greetings all,<BR>I&#039m a beginner with ASP (coming at this from being a Java developer) so please excuse if this is a stupid question *grin*<BR><BR>Basically, I need to know how to cause the browser to open a new window with a different page.<BR><BR>I have a select box with a list of reports in it, and a button labeled&#039go&#039 next to it. These are both in a form, and when the user presses the button, the following code is run:<BR><BR>If Request("rpt1But") = "Go" and Len(Request("rpt1")) &#062; 0 Then<BR>Response.Redirect(baseUrl & "report.pdf")<BR>End if<BR><BR>The problem is, this just redirects the browser to the PDF file in the same window. I need it to open a NEW browser window with the PDF file. SO ... PLEASE, how can I do this? :)<BR><BR>Additionally, just in case anybody knows, there is an issue with IE 5.01 and NT 4.0 where a PDF file may not be displayed correctly if the display is the result of a browser redirect. Response.Redirect certainly counts as a browser redirect ... is there any way to accomplish this that would not count as a redirect?<BR><BR>Thank you for your time.<BR><BR>-Ian Thomas

  2. #2
    Join Date
    Dec 1969

    Default RE: Browser redirect to new window based on form d

    you can put the page value in the option value<BR><BR>&#060;form action="Redirect.asp" method="Post"<BR>&#060;Select name="GoPage"&#062;<BR>&#060;option value="somepage.pdf"&#062;Name of page<BR>&#060;/Select&#062;<BR>&#060; input type="submit" value="Go"&#062;<BR>&#060;/form&#062;<BR><BR>then on the Redirect page<BR>&#060;%<BR>Dim PageVal<BR><BR>PageVal=Request.form("GoPage")<BR>< BR><BR>response.Redirect(PageVal)<BR>%&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts