質問

I am trying to enable and disable a datepicker with a checkbox, but I can not. What's wrong?

if ([checkBox state]==NSOnState) {
        [datePicker isEnabled];
    }
役に立ちましたか?

解決

The -isEnabled method is asking if the date picker is enabled. It doesn't change anything. You use -setEnabled: to change the state. For example:

[datePicker setEnabled:([checkBox state]==NSOnState)];

他のヒント

Change your Datepicker Input ID into annother ID with $(object).attr('id','new_id'), so the Datepicker is can't detect the input box. ex :

it would be easiest way :D *or it would be stupid way :), but it works

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top