parsley data-equalto not working
javascript, parsley.js
Solution
Been struggling with this for a few hours, found the answer courtesy of JoelCDoyle. I want to re-iterate it because though the question is dated, the answer provided by Joel works. Thanks! :)
<input type="password" name="pw" id="pw"
parsley-minlength="8"
parsley-required="true"
/>
<input id="pwtwo" type="password" name="pw-verify"
data-parsley-equalto="#pw"
parsley-required="true"
/>
this is the attribute you need to make the compare function work with parsley.js: `data-parsley-equalto="#pw"`
Problem
I'm trying to match up passwords using Parsley.js but it doesn't seem to be working. Here is the code: ``` <div class="control-group"> <!-- Password--> <label class="control-label" for="password">Password</label> <div class="controls"> <div class="input-prepend"> <span class="add-on"><i class="icon-eye-close"></i></span> <input type="password" id="password" name="password" placeholder="" class="input-xlarge" data-trigger="change" data-required="true" data-minlength="6"> </div> <p class="help-block">Password should be at least 4 characters</p> </div> </div> <!-- ************ NOT WORKING *************** --> <div class="control-group"> <!-- Password --> <label class="control-label" for="password_confirm">Password (Confirm)</label> <div class="controls"> <div class="input-prepend"> <span class="add-on"><i class="icon-eye-close"></i></span> <input type="password" id="password_confirm" name="password_confirm" placeholder="" class="input-xlarge" data-equalto="#password" data-trigger="change focusout" data-required="true" > </div> <p class="help-block">Please confirm password</p> </div> </div> ``` This part data-equalto="#password" should do the check, but it doesn't seem to work. I call the parsley validate in the form like so: ``` <form class="form-horizontal" id="userForm" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" data-focus="first" data-validate="parsley"> ```