[DateRangePicker] How to add a custom prompt text when the start/end range is null.

Forge Component
(7)
Published on 2019-01-02 by Niels Favreau
7 votes
Published on 2019-01-02 by Niels Favreau

I want to add a custom text to let users know the date range has not yet been defined and prompt action if they so wish to use it:


However on preparation values are automatically attributed to the start/end even though they are undefined and the variable null:


How can I keep the message to show on preparation and only change to date format once the widget is used?

Thanks. 

Solution

Hi Andre,


You can do that with JS. Please add the following code after the input on the screen (With Escape Content = No):

SyntaxEditor Code Snippet

"<script type=""text/javascript""> 
$('#"+<inputfield>.Id+"').val('Select date in future');
</script>"



Hope it helps!


BR,

Luís

Solution