ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
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
Save Changes
Cancel
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
Save Changes
Cancel
Omu
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
Omu
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK