aspページでjqueryを使用してフォームの入力時に送信ボタンを有効または無効にします。ユーザーが必要なすべてのフィールドに入力したときに、ボタンを有効にしてaspページのボタンのクラスを変更したいのですが、多くのコードを見つけましたが、1つも私の仕事ではありません。
(function() {
$('form > input').keyup(function() {
var empty = false;
$('form > input').each(function() {
if ($(this).val() == '') {
empty = true;
}
});
if (empty) {
$('#register').attr('disabled', 'disabled'); // updated according to http://stackoverflow.com/questions/7637790/how-to-remove-disabled-attribute-with-jquery-ie
} else {
$('#register').removeAttr('disabled'); // updated according to http://stackoverflow.com/questions/7637790/how-to-remove-disabled-attribute-with-jquery-ie
}
});
})()