asp.net mvc - jquery validate unobtrusive custom fields -
i have validation metadatas in asp mvc project.
i want validate metadatas in client side jquery.validate , jquery.validate.unobtrusive.
the problem metadatas [email], [phone] or [url] it's not validated in client side, it's validated in server side.
is there form of validating metadatas in jquery.validate?
is there somo form of adding custom validations in jquery.validate?
thanks.
if using jquey.validate below link has demo of ,
http://jquery.bassistance.de/validate/demo/
below example that
$().ready(function() { // validate comment form when submitted $("#yourform").validate(); // validate signup form on keyup , submit $("#yourform").validate({ rules: { firstname: "required", lastname: "required", username: { required: true, minlength: 2 }, password: { required: true, minlength: 5 }, confirm_password: { required: true, minlength: 5, equalto: "#password" }, email: { required: true, email: true }},
Comments
Post a Comment