且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用jQuery验证表单时出错

更新时间:2023-12-03 15:47:58

您的jQuery选择器省略了#符号. jQuery ID选择器应该包含如下所示的#:

Your jQuery selector for the form omits the # sign. The jQuery ID selector should include a # like so:

function SubmitForm() {
    $("#UrIntakeForm").valid(); // "#UrIntakeForm" instead of "UrIntakeForm"
 }

否则,您将valid()方法应用于空的jQuery对象,这将导致您指定的错误.

Otherwise you are applying the valid() method to an empty jQuery object, which results with the error you've specified.