私が書いたこのコードを持っていますが、機能していないようです。以下を参照してください。
$('#Reserve, #BuyItNowPrice, #featureplate').attr('disabled','disabled');
$('.fake-fieldset .fake-input').css({'background-color':'#e1e1e1'});
$('.enable').click(function(){
if($('.enable:checked')){
$(this).closest('input').removeAttr('disabled');
}
else{
$(this).closest('input').attr('disabled','disabled');
}
});
このHTML構造は、私のコードで3回繰り返されています。以下を参照してください。
<strong><input type="checkbox" class="enable" /> Specify Buy It Now Price</strong>
<div class="fake-fieldset">
<div class="fake-input">
<span>£ </span>
<input type="text" id="BuyItNowPrice" name="BuyItNowPrice" value="" />
</div>
</div>
私がしたい.enable
のは、ユーザーが値を入力できるように、最も近い入力がアクティブになることを確認するときです。
どんな助けでも大歓迎です、ありがとう