We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
从0.2.1升级到0.4.0后,之前正常的remote规则失效,使用默认的POST方式能正常验证,替换成GET方式不会触发任何验证。
js代码如下:
fields : { 'email' : 'required;email;remote(GET:/api/accounts/checking/email)' },
html代码如下:
<input id="email" name="email" type="text" class="form-control" autofocus="autofocus">
通过启用调试模式,在控制台输出:
0: api -> true
The text was updated successfully, but these errors were encountered:
@shelltea 确实存在这个问题。 在问题修正之前,如果要使用GET方式,可以先自定义临时的remote规则。 代码参考:
$('#form').validator({ rules: { remote: function(element){ return $.ajax({ url: 'check/email.php', type: 'get', data: element.name +'='+ element.value, dataType: 'json' }); } }, fields: { 'email': 'required; email; remote;' }, valid: function(form){ $.ajax({ url: 'results.php', type: 'post', data: $(form).serialize(), dataType: 'json', success: function(d){ alert('提交成功!'); } }); } });
Sorry, something went wrong.
51a1dae
niceue
No branches or pull requests
从0.2.1升级到0.4.0后,之前正常的remote规则失效,使用默认的POST方式能正常验证,替换成GET方式不会触发任何验证。
js代码如下:
html代码如下:
通过启用调试模式,在控制台输出:
The text was updated successfully, but these errors were encountered: