This is a migrated thread and some comments may be shown as answers.

Disable DatePicker and Model value getting lost.

5 Answers 196 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pim
Top achievements
Rank 1
Pim asked on 10 Jan 2011, 04:06 AM
Hello,

I am using the DatePicker for a couple of date controls.

But when I disable the controls (because of some business logic) the property in my Model that is bound to the DatePicker looses the value it has when submitting the form.
When I debug my Post Edit method I see that my Model has no values for the properties attached to the Terik DatePicker control.

Is this by design? Or am I doing something wrong?

I disable the control with the build in .disable() method.

When I disable a Telerik ComboBox, the attached property of my model keeps its value when Submitting.

How do I disable a Telerik DatePicker without the underlying model loosing its bound property?

Thanks,

5 Answers, 1 is accepted

Sort by
0
Jason
Top achievements
Rank 1
answered on 04 Mar 2011, 08:57 PM
I'm noticing the same thing... disabled date pickers don't post their value.
0
Nebras
Top achievements
Rank 1
answered on 07 Mar 2011, 09:43 AM
any solution for this ?
I need to disable the picker but sending its value
0
Georgi Krustev
Telerik team
answered on 07 Mar 2011, 06:26 PM
Hello Nebras,

This is an expected behavior. HTML input element will not post its value if it is decorated with disabled="disabled" attribute, which is the case here. You can overcome this limitation if you create hidden input element with the same name as DatePicker and post its value when the DatePicker is disabled.

Nevertheless I will forward this issue to our developer for further investigation and consideration.

 

Best regards,
Georgi Krustev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Nebras
Top achievements
Rank 1
answered on 09 Mar 2011, 09:02 AM
Thanks Georgi Krustev  , it works ..
0
Thomas Mayfield
Top achievements
Rank 1
answered on 11 Apr 2011, 07:54 PM
Disabled inputs don't post values when submitting forms.  This is a rule of HTML.  If you want the value to get posted when the control is disabled, you'll need to copy the value into a hidden element.

The spec is at http://www.w3.org/TR/html4/interact/forms.html#h-17.12
A good workaround (using readonly instead of disabled) can be found at http://stackoverflow.com/questions/4727974/how-to-post-submit-an-input-checkbox-that-is-disabled
Tags
Date/Time Pickers
Asked by
Pim
Top achievements
Rank 1
Answers by
Jason
Top achievements
Rank 1
Nebras
Top achievements
Rank 1
Georgi Krustev
Telerik team
Thomas Mayfield
Top achievements
Rank 1
Share this question
or