Мог бы хотеть попытаться поместить функцию PHP на другой странице PHP и использовать вызов Ajax для установки переменной.
var $submit = $("input[type=submit]");
if ( $("input:empty").length > 0 ) {
$submit.attr("disabled","disabled");
} else {
$submit.removeAttr("disabled");
}
var inputs = $('input', 'form#foo'), empty = false;
// can also use :input but it will grab textarea/select elements and you need to check for those..
inputs.each(function() {
if ( $(this).val() == '' ) {
empty = true;
return;
}
});
if ( empty ) {
$('#el').attr('disabled', 'disabled'); // or true I believe.
}
Отсутствует закрытие, попробуйте это, например, №1:
$(document).ready(function(){
$("#ask_form").validate(){
rules: {
username {
required: true,
minlenghth: 2
},
email: {
required: true;
minlength: 6
},
password {
required: true,
minlength: 6
}
}
});
});