“this[0] is undefined” message using jQuery validate plugin

前端 未结 4 2051
误落风尘
误落风尘 2021-02-13 19:09

I\'ve started to use the jQuery validate plugin. I was having a few issues with the display of the error messages and wanted to create a test page where I could experiment with

4条回答
  •  温柔的废话
    2021-02-13 19:25

    Wrap your code in a document ready function such as:

    $(function()
    {
    
        $('#myform').validate({
                        rules: {
                            thisval: "required"
                        }
        });
        console.info($('#myform').valid());
    
    });
    

提交回复
热议问题