TrekkieTechie Posted January 2, 2009 Report Posted January 2, 2009 Hi all, I am working on a site which interfaces with two different third-party form processors (web-form-buddy for validation and secure data transmission, SendThisFile for large file uploads). In order to achieve the desired effect, it's necessary to have two separate forms on the same page (one, INFO, which goes through web-form-buddy's CGI script, and one, UPLOAD, which copies some data from the INFO form and has file upload fields which goes through SendThisFile's servers). I currently have a working page which, when you hit the Submit button at the bottom of the page, fires the INFO submission to web-form-buddy and then fires the UPLOAD form to SendThisFile (achieved using this method). If the user correctly inputs all required data, it works like a charm. However, if the INFO form contains errors and fails validation, the UPLOAD form is still submitted. Is there a way to have the INFO form report back whether or not it was successfully submitted, and only fire the UPLOAD submission if INFO passes its validation? Thanks in advance for any help/advice. Quote
PicnicTutorials Posted January 2, 2009 Report Posted January 2, 2009 Are you saying, you have not used any of your own PHP code, nore do you want to enter any PHP form validation into the exsisting forms that you are using. If so, then from the sounds of it you can use some JS validation to make sure the form is filled out correctly before being sent off. JS can be turned off... Quote
falkencreative Posted January 2, 2009 Report Posted January 2, 2009 Hmm. Sounds like some sort of validation on your side (before the form submits to web-form-buddy) may be the way to go. One simple idea, though perhaps not ideal (since it would use Javascript for the validation, and that could be turned off) is to disable the submit button on the form until all the required fields have been filled in. Something along the lines of what I did here: http://salthe1040gal.com/co nta ct.html (remove spaces) Quote
TrekkieTechie Posted January 2, 2009 Author Report Posted January 2, 2009 You guys and your simple, logical solutions... that hadn't occurred to me at all. Thanks. It will have to be Javascript for now, as I don't know a lick of PHP, but I'll look into changing that in the near future. Thanks again. Quote
PicnicTutorials Posted January 2, 2009 Report Posted January 2, 2009 You guys and your simple, logical solutions... that hadn't occurred to me at all. Thanks. It will have to be Javascript for now, as I don't know a lick of PHP, but I'll look into changing that in the near future. Thanks again. Here is some JS validation... http://www.visibilityinherit.com/code/js-form-validation.php Quote
TrekkieTechie Posted January 8, 2009 Author Report Posted January 8, 2009 Thanks for the code, Eric -- I used it as a jumping-off point for my own validation routines. Just wanted to let everyone know that I got my forms working properly and validating well. Thanks for your help. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.