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];
}
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