タイトルが示すように、テキスト ボックスにテキストがない限り無効にしたいフォームの送信ボタンがあります。フィールドは適切に無効になっていますが、テキストが入力されると、送信は無効のままになります。
HTMLは次のとおりです。
<form method="get" action="#">
<input type="text" id="edit-combine" name="combined"/>
<input type="submit" id="edit-submit-clone-of-combined-search" value="search"/>
</form>
ここにjqueryがあります:
if($('#edit-combine').val().length == 0){
$('#edit-submit-clone-of-combined-search').prop("disabled", true);
}else{
$('#edit-submit-clone-of-combined-search').prop("disabled", false);
}
私はこれのために JSFiddle を作りました: http://jsfiddle.net/CR47/ZUmCp/