Print Page | Close Window

"post" without form

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=4754
Printed Date: 29 March 2026 at 12:00pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: "post" without form
Posted By: pedalcars
Subject: "post" without form
Date Posted: 05 August 2003 at 2:51am
I'm working on a project currently where I have a page in which you select data using a form with a "submit" button, which uses the "post" method to send said data to an action page which adds it to the DB. All fairly normal so far.

The action file displays nothing to the user and once the data has been added it response.redirects back to the data entry page.

I want the first page to know (be able to find) the DB record just created (eg, by the record ID), but for preference I don't want to put this in the URL. I also don't want to use cookies as it needs to work if users have cookies turned off. I can use the session ID but for preference I'd rather not, at least not as the only method, as I don't want the info to be lost if a session times out / gets terminated.

This is pointing me back to the action file "post"ing the ID back when it redirects, but as it doesn't write HTML, I can't create a form (can I?).

So, is it possible to post the data back given the above constraints?

Ta

-------------
http://www.pedalcars.info/ - www.pedalcars.info

The most fun on four wheels




Replies:
Posted By: Gary
Date Posted: 05 August 2003 at 6:34am

On the action page, once the db record has been written, you could then use javascript to set the value of a hidden <input> followed by submitting the form back to the original page.

You may need to have an additional page after the action page - something along the lines of.......

Form page -> Action page -> Additional page with form -> back to form page.



Posted By: pedalcars
Date Posted: 05 August 2003 at 6:45am
Thanks for the tip - but is there a way of doing it not using javascript as well? Not that I'm trying to be an awkward so and so...

I'm trying to make the system as resilient as possible regardless of what the user has turned off, be that cookies, javascript, etc.

It may be I have to use cookies if enabled and session ID failing that; if so, fair enough.

-------------
http://www.pedalcars.info/ - www.pedalcars.info

The most fun on four wheels



Posted By: Mart
Date Posted: 05 August 2003 at 10:34am
You have to use javascript or even more incompatible vbscript(client - side) to submit forms...


Posted By: Gary
Date Posted: 05 August 2003 at 10:41am

Mart, sorry, but that's not 100% true

What you could do is display a submit button on the third page (in my suggested solution) which when clicked will take the user back to the main form.

But there again, that's just plain stupid and me being a bit picky. lol.
However, I reckon it would work and means that Javascript is not required after all.

 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net