this site works best with javascript enabled
ASP.net
Awesome
Learn
Forum
Buy
Sign In
Ask Question
DatePicker disable doesn't work (fully)
Title:
B
I
{code}
?
Hi, I need to disable the DatePicker in my Edit Popup depending of some conditions. I found some samples on the web to allow to do that. $('#ContestStartDateSmc').datepicker().datepicker( "disabled" ); or $('#ContestStartDateSmc').datepicker().datepicker( "option", "disabled", false ); The issue is the button you added in the control right doesn't disabled when effectively the DatePicker itself is disabled. I could hack the button but for a lot of controls, it could take a lot of work. Do you have a trick to allow to achieve that in simple way ? thanks
vRITHNER
asked at 22 Sep 2018
Answers
B
I
{code}
?
`.datepicker()` is a jQueryUI extension, which we aren't using anymore, right now you can disable by setting disabled attribute to the input and the button of the datepicker
o
answered at 22 Sep 2018
txs. I have do what you describe and it works. Now another issue is coming in the game; when the control is disabled, during the save, the current date value won't pass to the model and the date is saved as. '0001-01-01 00:00:00.0000000' I 'm stuck with this pb. Can you please point me to a solution ? Txs
at 22 Sep 2018
vRITHNER
you could set the value of the datepicker in a hidden input with the same name; or hide the whole datepicker instead of disabling it, and show a label with its value, you could style it to look like the datepicker
at 22 Sep 2018
o
please
Sign In
to leave an answer