DatePicker dateInput serialization

2 posts, 0 answers
  1. Marcin
    Marcin avatar
    182 posts
    Member since:
    Jan 2011

    Posted 21 Nov 2017 Link to this post

    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.
  2. Georgi
    Admin
    Georgi avatar
    301 posts

    Posted 23 Nov 2017 Link to this post

    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.
Back to Top