I\'m a little confused about the JQuery validation plugin behavior.
If I have the following JQuery:
$(\'#form1\').validate({
/* other validation
A name
attribute is required on the element firstly because that's what jQuery validate uses internally as a key for each field, and secondly because the name
attribute is required on input
elements to ensure the page validates to the specified DOCTYPE.
If you want to apply the rules using the id then use like this,
$(function () {
var $field = $("#id_field").attr("name");
var $params = {debug:false, rules:{}, messages:{}};
$params['rules'][$field] = {"required": true, "rule": ["params"]};
$params['messages'][$field] = "error message";
$("#frm").validate($params);
});