Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- validation to check database
- $("#registerForm").validate({
- rules: {
- BCNumber : { required: true, minlength: 5, maxlength: 10 },
- Username : { required: true, minlength: 5, maxlength: 10 },
- Password : { required: true, minlength: 5, maxlength: 10 },
- SecurityQuestion : { required: true, minlength: 5, maxlength: 10 },
- SecurityAnswer : { required: true, minlength: 5, maxlength: 10 },
- }
- $("#registerForm").submit(function(){
- var id=//find the value to be checked
- $.get("url?id="+id,function(data){
- if(data=="valid"){
- //submit the form
- }else
- {
- return false;
- }
- })
- })
- $("#registerForm").validate({
- rules: {
- Username : {
- required: true,
- minlength: 5,
- maxlength: 10,
- remote: 'check_username.php'
- }
- }
- });
Add Comment
Please, Sign In to add comment