Jimmy Wadia wrote:Two forms because I would like to keep it as simple as possible.
I am intrigued by your suggestion to remove name=submit. It works well as of now. Just how it would replace the native submit function and cause problems, I would like to know.
Bear Bibeault wrote:Not sure anyone can offer any advice without understanding the situation. Validating one form, but submitting another, is a really odd thing to do and you haven't really explained why you're heading down that path.
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jeanne Boyarsky wrote:This still seems like it could be done in one form to me. But if you still want to do this, you can. You use JavaScript to set the relevant values (zip code) in the second form and then form.submit() to submit it.
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jimmy Wadia wrote:After all, I have submitted by problem in exquisite detail, enough for someone to give me a coding solution
But I've read your problem in detail and still see no reason whatsoever for all this complexity. In all of that you never explain why you feel you need a second form. What prevents you from validating and submitting the information in a single form?
Bear Bibeault wrote:The customary way to perform form validation is to establish a submit handler for the form. This handler gets called when the form is submitted. The script can check the form's values (or anything else it likes) and returns true to allow the form to proceed with the submission, or false to halt the submission. Displaying the errors on the page is a lot friendlier than alerts, but one step at a time.
Consider Paul's rocket mass heater. |