validation - Validate form with hidden fields -
in page there few hidden field filled correct value script. these fields validated server side against code injection , others malicius attacks i'd put code validate fields client-side. aim request field name = "name1" , "name2" contain string of 2 (not more not less) letters (not numbers) submit form. problem others fields using jquery validation plugin 1.9.0 if field hidden script doesn't work on it. i'm using following code tell validation roles follow:
$(document).ready(function(){ $("#myform").validate({ rules:{ my_hidden_field:{ required: true, minlength: 2, } }, messages:{ my_hidden_field: "this field not valid" }, errorlabelcontainer: "#boxvalidator", wrapper: "li", }); });
use ignore: []
validate hidden fields:
$("#myform").validate({ rules:{ my_hidden_field:{ required: true, minlength: 2, } }, messages:{ my_hidden_field: "this field not valid" }, errorlabelcontainer: "#boxvalidator", wrapper: "li", ignore: [] // <---- });
Comments
Post a Comment