0

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];
    }
Andrea
  • 427
  • 3
  • 16

2 Answers2

1

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)];
Ken Thomases
  • 88,520
  • 7
  • 116
  • 154
0

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

Acil Az
  • 170
  • 2
  • 9