Jquery – Can’t move focus to the control because it is invisible

datepickerjqueryjquery-ui

Take a look this sample from jqueryui.

http://jqueryui.com/demos/datepicker/#icon-trigger

it all working fine except for my case, my application can disable the date textbox. So if this textbox is disabled, the user can still click the icon trigger.

When user clicks this icon trigger, an error message comes out "Can't move focus to the control because it is invisible".

Could anybody help me?

Best Answer

This is because you can't move focus to a disabled control.

If you need to disable the text box then disable the date selector also.