I have been using this plugin and have run across a curious problem. When I use the following code, all works just fine:
<script>
$(document).ready(function()
{
// validate signup form on keyup and submit
var validator = $("#signupform").validate(
{
rules:
{
email:
{
required: true,
email: true,
remote: "check-email.php"
},
username:
{
required: true,
minlength: 2,
remote:
{
url: "check-vCode.php",
}
},
},
messages:
{
email:
{
required: "Please enter a valid email address",
remote: jQuery.format("email not found")
},
username:
{
required: "Enter Validation COde",
minlength: jQuery.format("Enter at least {0} characters"),
remote: jQuery.format("Code does not match")
},
},
// set this class to error-labels to indicate valid fields
success: function(label)
{
// set as text for IE
label.html(" ").addClass("checked");
},
highlight: function(element, errorClass)
{
$(element).parent().next().find("." + errorClass).removeClass("checked");
}
});
});
</script>
However, when I add this code (in bold), the code no longer functions and check-vCode.php never gets called:
<script>
$(document).ready(function()
{
// validate signup form on keyup and submit
var validator = $("#signupform").validate(
{
rules:
{
email:
{
required: true,
email: true,
remote: "check-email.php"
},
username:
{
required: true,
minlength: 2,
remote:
{
url: "check-vCode.php",
return $( "#email" ).val();
}
},
},
messages:
{
email:
{
required: "Please enter a valid email address",
remote: jQuery.format("email not found")
},
username:
{
required: "Enter Validation COde",
minlength: jQuery.format("Enter at least {0} characters"),
remote: jQuery.format("Code does not match")
},
},
// set this class to error-labels to indicate valid fields
success: function(label)
{
// set as text for IE
label.html(" ").addClass("checked");
},
highlight: function(element, errorClass)
{
$(element).parent().next().find("." + errorClass).removeClass("checked");
}
});
});
</script>
check-vCode.php only returns "false" (testing for now)
I appreciate any assistance.
thank you,
Shimon