简体   繁体   中英

jQuery validator: custom validation not working in Symfony2

I am trying to implement jquery validation in my symfony2 project.If i apply class="required " in a text field, the validation works fine but when try to apply custom validation like

$("#checkoutForm").validate({  
    rules: {
        checkout_name: {
            required:true
        } 
    }
});

Try this one

$("#checkoutForm").validate({  
    rules: {
        'checkout[name]': {
            required:true
        } 
    }
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM