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

DatePicker dateInput serialization

1 Answer 81 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Marcin
Top achievements
Rank 1
Veteran
Marcin asked on 21 Nov 2017, 04:08 PM

Hello

I would like to get rid of DatePicker placeholders like day/month/year when dateInput is set to true.

I'm setting null value to date picker and then it renders placeholders.

I would live with that but it has unpredictable behaviours:

  • JQuery Validation data-val-required is no longer working.
  • $("form").serialize() is serializing these values as text, when it should be null. So my ajax are failing.

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 23 Nov 2017, 11:12 AM
Hi Marcin,

Currently, the placeholder cannot be changed to anything custom. It is defined automatically based on the format value. It cannot be hidden too. It will be displayed if the component doesn't have value or it is partially entered.

A possible workaround is to set the value of the input element to empty string before the serialization and then restore the placeholder:


Another solution is to modify the scripts locally to not set any value in the input. The _updateElementValue â€‹private method of the DateInput (kendo.dateinput.js) widget sets the value.

Have in mind that we do not recommend modifying the scripts as only the current state is tested, also any local modifications will be lost after an update.


Regards,
Georgi
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Date/Time Pickers
Asked by
Marcin
Top achievements
Rank 1
Veteran
Answers by
Georgi
Telerik team
Share this question
or