Jump to content

Auto process a form...how?


dwest

Recommended Posts

I've got a form with several submit buttons.

The form posts to a processing page which first determines what submit button was clicked, and then runs a corresponding function.
All of those functions post back to the original form with the results of the functions.

I need one of those functions to simply take the posts from the original form and post them back without stopping for the user to click a submit button.

Is that possible?

Thanks!
Link to comment
Share on other sites

You could just do a GET request back to the original form page. So in that special function just do a redirect with originalform.htm?postvar1=value1&postvar2=value2 as the URL
If your functions are before the header output, you can use a header location redirect, otherwise you'll have to use javascript redirect.
Link to comment
Share on other sites

Any quickie code clips on a javascript redirect so I can use POST?  I know no javascript :-(

I've avoided sessions purposely with this and don't want to use them now just to accommodate this one little thing.  I do appreciate the suggestion though :)

I thought about get but there are a ton of variables as this loop repeats until the user is satisfied.  Are there any side effects of really loooooong urls?
Link to comment
Share on other sites

I believe you can if you serialize()/unserialize() it first, though I'm not sure about that...jesirose, any ideas? As far as length, I know that there are no specific limits (in the RFC...I think) other than what a browser will support. Explorer only goes to 2,048 characters...so it might work. If you are thinking that the user might be doing this a lot, then sessions would probably work best, even just on one page.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.