drob50257447 2016-09-09 13:45
浏览 70

Jquery验证两种形式 - 用于识别表单的语法

Always with the same dilemn not resolved (two step forms on the same page with no working jquery validate. The two forms and all fields have different names and id.) (Beginner jquery and ajax).

 $('form[name="clt"]').validate({
});

First of all is it the right syntax to recognize form ? It's two step forms (validation step by step/form). The errors messages aren't working Thanks.

  • 写回答

1条回答 默认 最新

  • dongxiao3694 2016-09-09 18:12
    关注

    You have to use .validate() for each form. Did you named them differently?

    In your example you have only:

    $('form[name="clt"]').validate({
    });
    

    You have to have two:

    $('form[name="form1"]').validate({});
    $('form[name="form2"]').validate({});
    

    If it's not two forms as it's in your title but two step form as in your description:

    $(".buttonYouClickForNextStep").click(function () {
         $('form[name="clt"]').validate({
        });
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题