Validate Multiple Custom Forms on same PHTML file.
I have 3 forms on same phtml file i trying to validate the input fields. One time one form is shown
Sign In { if successful} WriteReview { otherwise } signup
Custom js is also triggered on click of submit, but I want to do this with Magento validations.
In /var/www/html/magento16/app/design/frontend/base/default/template/reviewrating/signupformhb.phtml''
<form method="POST" action="#/" accept-charset="UTF-8" id="hb_user_login" onsubmit="event.preventDefault(); user_login();" class="form-horizontal" enctype="multipart/form-data" novalidate="novalidate">
<input required="" id="email" name="email" type="email" class="required-entry validate-email" value="" aria-required="true">
.................. ...
<form method="POST" action="#/" accept-charset="UTF-8" id="hb_user_signup" onsubmit="event.preventDefault(); user_login();" class="form-horizontal" enctype="multipart/form-data" novalidate="novalidate">
<input required="" id="email" name="email" type="email" class="required-entry validate-email" value="" aria-required="true">
.................. ... ........
<script type="text/javascript">
//<![CDATA[
var dataFormLOGIN = new VarienForm('hb_user_login', true);
var dataFormSIGNUP = new VarienForm('hb_user_signup', true);
//]]>
</script>
As @Piyush sir told that it validates form before submmiting what i am little bit confused that if i create two seprate objects of VarienForm
(VIZ dataFormLOGIN
& dataFormSIGNUP
why magento mix ids of two different forms ?
Issue: validation work on few fields only not in all fields