Javascript pgwModal内部的jQuery绑定问题
我使用模式弹出窗口登录,我只有用户名和密码字段,我使用以下代码-Javascript pgwModal内部的jQuery绑定问题,javascript,jquery,data-binding,popup,pgwmodal,Javascript,Jquery,Data Binding,Popup,Pgwmodal,我使用模式弹出窗口登录,我只有用户名和密码字段,我使用以下代码- $(document).on("submit", "#testForm", function(e) { e.preventDefault(); console.log($('#testForm .requiredxx').length); $('.requiredxx').each(function() { va
$(document).on("submit", "#testForm", function(e) {
e.preventDefault();
console.log($('#testForm .requiredxx').length);
$('.requiredxx').each(function() {
var $this = $(this);
if($this.val() == ''){
console.log('blank');
}
});
});
以下是html:
<div id="pgContent">
<form action="#" id="testForm">
<li><input type="text" class="requiredxx" placeholder="user name"></li>
<li><input class="requiredxx" type="password" placeholder="password"></li>
<input type="submit" value="Login">
</form>
</div>
你知道为什么会这样吗
哎呀!我在中发现了这个问题,请也参考这个,这说明真正的问题是PGWModal插件,Link-
如果您打开页面源代码并搜索.requiredxx,您会看到多少次?您可以添加testForm的html代码吗?我已经用html更新了问题,请查看此链接-
$('.testlink2').on('click', function() {
$.pgwModal({
target: '#pgContent',
maxWidth: 350,
titleBar: false
});
});