非同期を無効にせずにこの ajax 関数を機能させる方法を知っている人はいますか? Asynx=false はすべてをフリーズします...
<script type="text/javascript">
$(document).ready(function () {
$('#form5').bValidator();
});
function checkUsername(username){
var ret = false;
$.ajax({
type: 'POST',
url: 'checkuser.php',
sync: false, // Want to remove this
data: {'username':username},
success: function(data){
if(data == 'ok')
ret = true
}
});
return ret;
}
</script>
<form id="form5" method="post">
<p> Choose username:
<input type="text" data-bvalidator="checkUsername,required" data-bvalidator-msg="This username is not valid or already taken.">
</p>
<p>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</p>
</form>
http://karmela.fsb.hr/~bmauser/bvalidator/documentation.html#serversidevalidation