Created
October 1, 2013 12:49
-
-
Save Pierry/6777931 to your computer and use it in GitHub Desktop.
Validação de senhas com a Kendo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Add Form Fields --> | |
<div id="securityDetails"> | |
Password: <input type="text" id="password" class="k-input" required /><br /> | |
Confirm Password: <input type="text" id="confirmPassword" class="k-input" required /><br /> | |
<button id="setPass" type="button" class="k-button">Set Password</button> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add Validator code | |
var validator = $('#securityDetails').kendoValidator({ | |
rules: { | |
match: function(input){ | |
if (input.is("#confirmPassword")) { | |
return input.val() === $("#password").val(); | |
} | |
return true; | |
} | |
}, | |
messages: { | |
match: "Senhas devem conferir" | |
} | |
}).data("kendoValidator"); | |
$('#setPass').on('click', function(){ | |
validator.validate(); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment