Sign in to follow this  

[web] asp jscript passing variables to another asp page

This topic is 4087 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have an online order form in html that posts all its form elements to another page called processorder.asp. In processorder.asp I gather all the information into variables and I need to then pass it to another page, but have the variables be posted to that other page as if they came from a form. How can I do this? So the setup is as follows: order.html ---> processorder.asp ---> transaction.asp In processorder.asp I get the values by using Request("var name"). But then I need to automatically redirecto to transaction.asp and make it think it was called from order.html so the variables I'm getting from Request("..") get put back in there, but with different names. Any help? ***EDIT***** Oh, and I cannot do this by simply passing the variables in the Response.Redirect string. The values must be hidden.

Share this post


Link to post
Share on other sites
Personally I'd try to do this without requiring another page. Are the pages on the same server? Can you not simply incorporate them into the same page by combining the source code (or if they have to be separate, create an include and put common functionality in there to reuse the code)?

If it's on another server, you could consider using a server-server POST by using some ActiveX object capable of doing this (Maybe MSXML HttpRequest? Or something from WinInet?)

Alternatively you could pass hidden fields back to the browser and have it do a POST to the other page with a form of hidden fields, but that would risk the user making unauthorised modifications - presumably you have done some validation on these values and want the values kept in their validated state.

Mark

Share this post


Link to post
Share on other sites
Unfortunately I do not have a choice but to post the data to the 2nd page. I have the 1st page creating the hidden fields in a form but how do I force a page submit without the user pressing a button?

Share this post


Link to post
Share on other sites
Well I figured it out. I simply grabbed the form data from the 1st page, and in the 2nd page did Response.Writes to create another form with hidden fields and set the ACTION property to the 3rd page. Then in the onLoad event I forced the form to submit itself.

Share this post


Link to post
Share on other sites

This topic is 4087 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this