Hi,
I have a large form with several repeat groups.
I collect product information on the form, and add the products to a virtuemart shopping cart upon submitting the form. I use form_xx.js to collect the products which were submitted on the form and add them to the Virtuemart cart.
My problem is that if the form fails a validation upon submit, for example if a user forgets to enter their name in the name field element on the form, the form_xx.js is still called and the products are added to the shopping cart and the user is prompted to correct the missing info on the form. When they correct the missing info and once again submit the form, there are now twice as many products added to the shopping cart.
So my questions is how do I detect, after the form is submitted, if the validation has passed or failed, so that I can check the validation status in form_xx,js and not add products to the cart if the validation has failed.
I cannot us ajax validation on the form, so need the php validation checks.
Thanks...
I have a large form with several repeat groups.
I collect product information on the form, and add the products to a virtuemart shopping cart upon submitting the form. I use form_xx.js to collect the products which were submitted on the form and add them to the Virtuemart cart.
My problem is that if the form fails a validation upon submit, for example if a user forgets to enter their name in the name field element on the form, the form_xx.js is still called and the products are added to the shopping cart and the user is prompted to correct the missing info on the form. When they correct the missing info and once again submit the form, there are now twice as many products added to the shopping cart.
So my questions is how do I detect, after the form is submitted, if the validation has passed or failed, so that I can check the validation status in form_xx,js and not add products to the cart if the validation has failed.
I cannot us ajax validation on the form, so need the php validation checks.
Thanks...