81
Views
1
Comments
Solved
[DateRangePicker] How to add a custom prompt text when the start/end range is null.
Question
daterangepicker
Web icon
Forge asset 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. 

2021-07-14 09-27-33
Luís Cardoso
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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.