Reputation: 1786
I am using jquery validationEngine for forms validation. But i'm unable to validate the form verify password field. It just says "fields do not match" while i type the same in password as well as verify password fields. Here is my code,
<link href="/js/jq_validation/validationEngine.jquery.css" rel="stylesheet" type="text/css" media="screen" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
<script src="/img/shop/local.glasses2020.co.uk/contents/js/jquery.validationEngine-en.js" type="text/javascript" ></script>
<script src="/img/shop/local.glasses2020.co.uk/contents/js/jquery.validationEngine.js" type="text/javascript" ></script>
<script>
$(document).ready(function(){
$(".test2").validationEngine();
});
</script>
<!---<script src="{$strREQUEST_URI}/img/shop/local.glasses2020.co.uk/contents/js/jquery.validationEngine_old.js" type="text/javascript" ></script>-->
<form method="post" action="{$strSecureREQUEST_URI}/register?{$smarty.server.QUERY_STRING}" id="registerform1" name="registerform" class="test2">
<div class="fname">
<div class="txtl">Username:<span style="color:red;"> *</span></div>
<div class="field">
<input type="text" class="validate[required,length[0,100]] textfield" value="" name="user" id="user" data-errormessage-value-missing="* Username is required!" data-errormessage-custom-error="Let me give you a hint: someone.noone" />
</div>
</div>
<div class="fname">
<div class="txtl">Password:<span style="color:red;"> *</span></div>
<div class="field">
<input type="password" class="validate[required] text-input" value="" name="pass" id="password2" data-errormessage-value-missing="* Password is required!" />
</div>
</div>
<div class="fname">
<div class="txtl">Verify Password:<span style="color:red;"> *</span></div>
<div class="field">
<input type="password" class="validate[required,equals[password2]] text-input" value="" name="vpass" id="vpass" data-errormessage-value-missing="* Verification Password is required!" />
</div>
</div>
</form>
Please help me figure out the issue!
Upvotes: 0
Views: 1835
Reputation: 2802
For check confirm password and minimum character validation, then you can use
<input type="password" id="password" name="password" class="validate[required,minSize[8]]"/>
<input type="password" id="confirm_password" name="confirm_password" class="validate[required,equals[password]]"/>
Upvotes: 0
Reputation: 1786
OK. I got the issue. I was using old version of validation engine files. So i updated my files and it worked. Moreover, Be careful about the forms and elements ids. They should be different. Also, referring to the "Aritra Chakraborty" answer above, the name and id not need to be same. Be careful about that, If you have multiple forms with password and verify password fileds, make sure the name should remain same if more than one forms submit to same link and ids should be different!
Upvotes: 1
Reputation: 2522
i think your
name="pass" id="password2"
should be same like
name="password2" id="password2"
in the password filed. Please let me know if you face any problem.
UPDATE
the only problem i got from your code is
<input type="password" class="validate[required] text-input" value="" name="pass" id="password2" data-errormessage-value-missing="* Password is required!" />
should be like
<input type="password" class="validate[required] text-input" value="" name="password2" id="password2" data-errormessage-value-missing="* Password is required!" />
Upvotes: 0