Link to home
Start Free TrialLog in
Avatar of MilburnDrysdale
MilburnDrysdale

asked on

Submit form data and go to related page at the same time (within one page)

Hello - have a form with a list box and two text boxes. Wanting to capture the form input as url parameters when the form is submitted and redirect at the same time (kind of like a jump screen?). Here is what I have that does not work because (I assume) the forms don't get submitted prior to the redirect...

<form id="form1" name="form1" method="post" action="">
  <select name="terminal" id="terminal">
    <option value="Select Terminal From List">Select Terminal From List</option>
    <%
While (NOT rs1.EOF)
%>
    <option value="<%=(rs1.Fields.Item("TERMINAL").Value)%>"><%=(rs1.Fields.Item("TERMINAL").Value)%></option>
    <%
  rs1.MoveNext()
Wend
If (rs1.CursorType > 0) Then
  rs1.MoveFirst
Else
  rs1.Requery
End If
%>
  </select>
  <label>
  <input name="startdate" type="date" id="startdate" />
  </label>
  <label>
  <input name="enddate" type="date" id="enddate" />
  </label>
  <label>
  <input name="Submit2" type="submit" onclick="MM_goToURL('parent','PAG_PUD_ROUTES_XLS.asp?<%= Server.HTMLEncode(MM_keepForm) %>');return document.MM_returnValue" value="Submit" />
  </label>
</form>


Can I do this at the same time?
ASKER CERTIFIED SOLUTION
Avatar of BraveBrain
BraveBrain
Flag of Norway image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MilburnDrysdale
MilburnDrysdale

ASKER

Thanks for pointing me in the right direction...changed it to this and it works...

<form id="form1" name="form1" method="get" action="PAG_PUD_ROUTES_XLS.asp?<%= Server.HTMLEncode(MM_keepForm) & "TERMINAL=" & rs1.Fields.Item("TERMINAL").Value & "&" & "STARTDATE=" & request.Form("startdate") & "&" & "ENDDATE=" & request.Form("enddate") %>">
  <select name="terminal" id="terminal">
    <option value="Select Terminal From List">Select Terminal From List</option>
    <%
While (NOT rs1.EOF)
%>
Glad to help. Thanks for the points and grade :)