Log in

View Full Version : Is it possible to process my form in two ways?



theemorgandorfer
06-09-2010, 05:12 PM
I don't have access to the server where the ASP script resides, thats why im asking this question. Can I have my form process through scripts server, but also send a copy to my email on the form's inputed fields? I've attached the form.

Thanks, greatly appreciate any help!

The form is at this link, can't attach it:

http://www.mightymarketing.com/daleross/homeevaluation7.html

djr33
06-09-2010, 06:34 PM
No. You cannot submit a form twice. A form goes one place and the user then continues from that page.

You could recreate the ASP code, or you could create a page that generates hidden fields from the sent POST data after processing it, then asks the user to submit the new form (same info) by pressing a "Continue" [submit] button.

You could also process the post data yourself then forward this from your server to the ASP form on the other server. I don't know how using ASP, but in PHP there is a set of functions called "curl" that allow a post call 'behind the scenes' from the user. So you could use that.


But this is all very high level, advanced programming. There should be an easier way. If you MUST do this and absolutely cannot get access to the ASP or copy the ASP script on your own server, then I guess you'll have to try it using one of the methods above.

prasanthmj
06-10-2010, 12:44 PM
Yes, It is possible. You can submit the same form to different scripts.

The page below contains examples and sample code.

How to create a multi-submit form (http://www.html-form-guide.com/blog/web-form/91/submit-form-multiple-scripts/)

djr33
06-10-2010, 07:27 PM
Relying on Javascript like that is a terrible idea. It's possible to use Javascript, yes. But if the user does not have Javascript or for some reason wants to avoid using Javascript on the page (intentionally submitting the form incorrectly?), then it will not work and it will submit, at most, once, or potentially not at all if the Javascript doesn't "fall back" well to normal methods.

If you use that Javascript method as an OPTIONAL addition (so only one submission is required and the second is a bonus), that's fine.
Or you can use the Javascript to make it smooth and have some other fall back option that doesn't rely on that for users who don't have/use Javascript.