Skip to main content

Search and Top Navigation

#8001 closed bug (notabug)

Opened January 10, 2012 06:07PM UTC

Closed January 10, 2012 06:32PM UTC

Last modified June 11, 2015 02:52PM UTC

Readonly parameter ignored by datepicker

Reported by: brunobg Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.datepicker Version: 1.8.16
Keywords: Cc:
Blocked by: Blocking:
Description

If a input tag has the readonly parameter set to true, datepicker still works and changes its value. This differs from disabled, because readonly still posts the form data but disabled does not.

How to reproduce: <input class="datepicker" readonly="readonly" type="text"/>

This seems to be somewhat related to #5644. Proposed fix: alter _connectDatepicker() and append at its end the following code:

if( input.attr('readonly')) {
    this._disableDatepicker( target );
}

and change ._disableDatepicker so that it does not call these lines if readonly is enabled:

target.disabled = true;
inst.trigger.filter('button').
each(function() { this.disabled = true; }).end().
filter('img').css({opacity: '0.5', cursor: 'default'});
Attachments (0)
Change History (3)

Changed January 10, 2012 06:32PM UTC by scottgonzalez comment:1

resolution: → invalid
status: newclosed

This is as designed. Don't enable the datepicker if you don't want users choosing dates.

Changed June 11, 2015 02:46PM UTC by serhio comment:2

If I don't enable the datapicker, I am not able to send data via a POST request.

I need to send data of a value of datepicker, but not allow users to modify its value.

A DISABLED datepicker does not send any data to POST requests ((

Changed June 11, 2015 02:52PM UTC by scottgonzalez comment:3

I really don't know what you're referring to. Attaching the datepicker does nothing in terms of what fields are submitted. You should use the forums, IRC, or Stack Overflow for support.