Hi,
I'm building a website for hiring vacational houses. When you go to a particular house, you can navigate through a tabbed menu where you can get the information about the house, a gallery, availability, rates and a booking form.
As the number of houses can be huge (well, at least we hope so) making a form for each house is not reasonable, so i've created a webform node that I include in each house using the viewfield module... in other words, it's always the same form with a hidden field containing the url from where it's submitted. So when the e-mail is received, you know which porperty the sender wants to book.
The form is working fine when you fill the form correctly, but there are several fields that are required (mandatory) and here the problem begins.
If you leave blank or fail to correctly fill any of the mandatory fields and click the submit button, the form, of course is not sent, but it reloads... and after the reload finishes you can see the form again with the wrong fields marked in red, but... you're no more in the house page, the reload takes you to the webform node itself. I mean it's not the view, but the node what you get after the reload, so if the sender fills correctly the fields marked in red and clicks the submit button, I'll get the url of the booking form in my e-mail and I won't know which house is the sender interested in.
I've read some posts with validation snippets in php, but as I'm only a web designer an my skills at php can be considered a joke, I just cant figure how to prevent this from happening.
Thanks in advance for your help.
Comments
Solved
Well, after reading a bit more, I've managed to solve this using jQuery validation, just copying and modifying the webform-form.tpl.php, as explained in this node