How to use jquery.validate plugin in cakephp form

前端 未结 3 913
天涯浪人
天涯浪人 2021-01-02 09:39

My jQuery code is:

$(document).ready(function(){   
  $(\'#StudentRegisterForm\').validate({          
    rules: {
      email: {
        required:true,
            


        
3条回答
  •  一整个雨季
    2021-01-02 10:33

    The first one is better to use, because this will maintain cake this->data structure, but second one is not. This is to remind that, when you will use the data[modelname][fieldname] give the class name in the input aray like:

    input('email',array('type'=>'text','class' => array('required','email'),'error'=>false,'label'=>false,'div'=>false));  ?>
    

提交回复
热议问题