views:

1271

answers:

2

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?

+1  A: 

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.

rahul
A: 

Just found the solution:

I just add this extra on my datecontrol

if (document.getElementById('XXXXXX_DateText").disabled == true) { $("#XXXXXX_DateText").datepicker('disable'); }

shoden