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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hidden variables and passing data from one page to another

Status
Not open for further replies.

ColdFusionKing

Programmer
Dec 5, 2002
145
GB
Hello Everybody, I desperately need someone to help me. I am working on a Order Form, users can rent or buy desktops.
I have a form with a couple of text fields and drop downs common to users renting and ordering desktops. There are two submit buttons "rent" and "buy". The user fills in the textboxes and select boxes and hits on "rent" or "buy". The form method is "post".

If the user hits the "rent" button, I want the user to be taken to another page "rent.html" passing all the form field values in hidden variables,
similarly when the user hits on "buy" button, I want the user to be taken to "buy.html" passsing all the form field values in hidden variables. I don't
know how to pass hidden variables to the action page and retreive their values in the action page. Can somebody please show me how to do this. I am not using any server side language, only javascript and html. Is it possible to do this in client side language? Please can somebody show me how to do this

Here is my form

<form name=&quot;the_form&quot; method=&quot;post&quot;>
<table border=&quot;1&quot; height=&quot;223&quot;>
<tr>
<td class=&quot;lightblue&quot; colspan=&quot;2&quot; height=&quot;22&quot;>Order Date</td>
<td colspan=&quot;2&quot; height=&quot;22&quot;>
<input type=&quot;text&quot; name=&quot;orderDate&quot; value=&quot;&quot; size=&quot;56&quot;></td>
</tr>
<tr>
<td class=&quot;lightblue&quot; colspan=&quot;2&quot; height=&quot;22&quot;>Telephone Extension</td>
<td colspan=&quot;2&quot; height=&quot;22&quot;>
<input type=&quot;text&quot; name=&quot;telExtension&quot; value=&quot;&quot; size=&quot;56&quot;></td>
</tr>
<tr>
<td colspan=&quot;2&quot; height=&quot;22&quot;>
<select name=&quot;Category&quot;&quot;>
<option> Current_Affairs
<option> Finances
</select>
</td>
</tr>

<table width=&quot;200&quot; height=&quot;30&quot; border=&quot;0&quot; align=&quot;center&quot;>
<tr>
<td width=&quot;100&quot;><input type=&quot;submit&quot; name=&quot;rentsubmit&quot; value=&quot;rent&quot;></td>
<td width=&quot;100&quot;><input type=&quot;submit&quot; name=&quot;buysubmit&quot; value=&quot;buy&quot;></td>
</tr>
</table>
</form>

Many Thanks
Allan
 
Hmmmmm... I don't believe there's any way to do it client-side, no. Because on a form post, the data is posted to the server in the headers for the post itself... but by the time the server does an internal request for the action page, those headers are gone, I'm pretty sure.

You might be able to do a method=&quot;get&quot; on your form... that would put all the values on the URL query string of the action page... and you may be able to have javascript parse through them then... but you'd be limitting the amount of data that you can pass then, and I'm not even sure javascript can get at the value of the query string.

You might want to ask over in the javascript forum. forum216



-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top