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!

Passing Parameters - Please help - Major Crisis

Status
Not open for further replies.

sthibodeau

Technical User
Aug 12, 2003
39
0
0
US
How do i take an input box andsubit button and pass the parameters to another page.

To expand on what i am doing is i have an Input box that requires the user to input a date. From there to press the button which will go to another page and hence filter all the records for that date.

Please Help as i am at a total loss.

Thank you in advance to the awesome person that will take the time to help resolve my miserable crisis and give true meaning to my humdrum life.
 
Ok, so it looks like you have 2 pages, the first one that accepts the user data and the second that will take that input and then (presumably) run a SQL string that will filter the results based on that date. So, on the first page, create something like this:
Code:
<form name=&quot;frmMain&quot; method=&quot;post&quot; action=&quot;Page2.asp&quot;>
[tab]<input type=&quot;text&quot; name=&quot;thisDate&quot;>
[tab]<input type=&quot;submit&quot; name=&quot;btnSubmit&quot; value=&quot;Submit&quot;>
</form>

(Bear in mind that you would probably also want to verify that the user enters a date using client-side scripting.) And then, on your second page (or Page2.asp), it will receive the data when the user clicks on the Submit button on the first page and you can create your SQL string and go from there. Here's a sample for Page2.asp:
Code:
<%
dim UserDate, strSQL
UserDate = Request.Form(&quot;thisDate&quot;) 'this will set a variable for the user-inputted date.
strSQL = &quot;SELECT var1, var2 FROM myTable WHERE DateVar = &quot; & UserDate
%>

Hopefully, this gives you an idea on how to accomplish what you need. And if this is a miserable crisis in your humdrum life, would you like to switch? [lol]


--------------------------------------------------------------------------------------------------------------------------
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
--Douglas Adams
 
Just looked back at this and realised that my [TGML] tags are a little screwy. The first piece of code should look like this:
Code:
<form name=&quot;frmMain&quot; method=&quot;post&quot; action=&quot;Page2.asp&quot;>
  <input type=&quot;text&quot; name=&quot;thisDate&quot;>
  <input type=&quot;submit&quot; name=&quot;btnSubmit&quot; value=&quot;Submit&quot;>
</form>

--------------------------------------------------------------------------------------------------------------------------
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
--Douglas Adams
 
Thanks for all your hep, that did the trick!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top