[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

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?
0
MilburnDrysdale
Asked:
MilburnDrysdale
  • 2
1 Solution
 
BraveBrainCommented:
>Can I do this at the same time?
No. Not unless you send the MM_goToURL to a different window so that the form get to submit.
From what you explained it kinda sounds like you're trying to do this though:

<form id="form1" name="form1" method="post" action="PAG_PUD_ROUTES_XLS.asp?<%= Server.HTMLEncode(MM_keepForm) %>">
  <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" value="Submit" />
  </label>
</form>
0
 
MilburnDrysdaleAuthor Commented:
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)
%>
0
 
BraveBrainCommented:
Glad to help. Thanks for the points and grade :)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now