Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Can';无法使用jQuery验证程序验证动态输入?_Javascript_Jquery_Jquery Validate - Fatal编程技术网

Javascript Can';无法使用jQuery验证程序验证动态输入?

Javascript Can';无法使用jQuery验证程序验证动态输入?,javascript,jquery,jquery-validate,Javascript,Jquery,Jquery Validate,我已经阅读了关于这个问题的大部分问题的答案,但到目前为止还不能让它工作,两天了,我有这个表格 <form id="mr_project_form" class="post" role="form"> <label class="fre-field-title" for="fre-project-title">Your project title</label&

我已经阅读了关于这个问题的大部分问题的答案,但到目前为止还不能让它工作,两天了,我有这个表格

<form id="mr_project_form" class="post" role="form">
    <label class="fre-field-title" for="fre-project-title">Your project title</label>
    <input class="input-item text-field" id="fre-project-title" type="text" name="post_title" placeholder="Add more than 15 characters"/>
    <!--Submit button-->
</form>
然后在一个AJAX调用之后,由AJAX响应注入一个输入,因此表单如下所示

<form id="mr_project_form" class="post" role="form">
    <label class="fre-field-title" for="fre-project-title">Your project title</label>
    <input class="input-item text-field" id="fre-project-title" type="text" name="post_title" placeholder="Add more than 15 characters"/>

    <!--Inserted input-->
    <input class="input-item text-field" id="inserted_input" type="text" name="inserted_input"/>
    <!--Submit button-->
</form>
$.ajax({
  url: mr_ajax_url,
  type: "POST",
  data: dataString,
  success: function (response) {
    $("#" + insertLcation).html(response);
    $('#inserted_input').rules('add', { digit: true, });
  },
});
但是它不能被验证,我在pageload上得到这个错误

TypeError:t.validator.methods[a]未定义;无法访问其“调用”属性

TypeError:s未定义;无法访问其“窗体”属性


它的
数字
带有
s
,而不是
数字

$('#inserted_input').rules('add', { digits: true, });

什么是
insertLcation
?@ewwink这个AJAX插入html到不同的地方,所以我创建了一个函数,接受一个位置,然后执行AJAX,它工作得很好,但问题是插入的字段无法验证。哦,谢谢,它工作了,但仍然会出现第二个错误,你知道为什么吗?无法复制错误,我不能在你的代码中添加
s
$('#inserted_input').rules('add', { digits: true, });