jQuery validation fails when using KnockoutJS and Jquery dialog

前端 未结 2 644
闹比i
闹比i 2020-12-29 17:31

I have a form which is rendered using html.RenderAction in MVC3.

Outside of this I have a jquery template used with knockout. The model is rendered correctly into t

2条回答
  •  再見小時候
    2020-12-29 17:43

    I have looked into the code of jQuery validate and I think it doesn't work for dynamically added forms (which what Knockout does).

    Take a look at this > Jquery Validation Plugin, dynamic form validation

    You need to call the validate() method in a an event handler registered using the jQuery live() method. The live method links to all the dynamically added elements as well.

    Let me know if it works.

提交回复
热议问题