c# - How to bind jQuery.validate.js verification to a dynamically added form
漂亮男人
漂亮男人 2017-05-16 17:05:39
0
2
748

How to bind jQuery.validate.js verification to a dynamically added form
Can you help me a lot

漂亮男人
漂亮男人

reply all(2)
给我你的怀抱

If you are using asp.net mvc and use jquery.validate.unobtrusive.js (asp.net mvc’s own validation, something that can be used in combination with class features)

Then you just add this js code before loading the page

    //动态表单验证
    $(document).ajaxComplete(function () {
        $.validator.unobtrusive.parse(document);
    });
PHPzhong

Is your form id predictable? If so, just write it in js:

$("#demoForm").validate();

That’s it. If even the ID is dynamically generated, just call the generated id directly in the view:

$("@ViewBag.FormId").validate();
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template