bootstrap-datepicker icon indicating copy to clipboard operation
bootstrap-datepicker copied to clipboard

Disabled field still allows date picker to change value.

Open EminenceHC opened this issue 12 years ago • 7 comments

Even though a field is disabled, the datepicker will allow the value to be changed. How can I disable this?

EminenceHC avatar Feb 10 '14 19:02 EminenceHC

Hi @EminenceHC - can you share any code with us??

ScottBaxter1 avatar Feb 11 '14 11:02 ScottBaxter1

Whether an input is enabled or not, JavaScript can change its value. This isn't specific to this datepicker and can be desired behavior (in the case of showing the selected date but not allowing the user to edit outside of using the datepicker).

Perhaps you could use the embedded/inline datepicker with your own markup and custom behavior?

studiochris avatar Feb 14 '14 07:02 studiochris

@EminenceHC can you provide an jsfiddle example for this issue?

acrobat avatar Dec 26 '14 17:12 acrobat

Sample taken from #800: http://jsfiddle.net/VUcjY/1/

cplaetzinger avatar Jan 20 '15 09:01 cplaetzinger

Well, we use the datepicker as a polyfill for date input fields, and as such, we try to have the behaviour resemble that a native date input field would have. That means: If the field is disabled (or also readonly), the user can not change it's value. I think datepicker should behave in the same way.

McNetic avatar Nov 26 '15 15:11 McNetic

+1 for read only datepicker

mediavrog avatar Feb 11 '16 04:02 mediavrog

Fixed in #1731

acrobat avatar May 08 '16 12:05 acrobat