1445
Views
8
Comments
Issue in resetting or clearing the Datepicker

I am developing an application where I have used the date picker where user can select future date and time and showing an error message if the date and time is not in future.  

There is one clear button which sets the input field to empty. The clear button is working fine except one case when the validation error message is showing and I press the clear button, the date-time input does not clears first time but when I press it second time it clears the input.


I already tried the below solution but it is not working for me. I am also attaching the sample OML for issue.

Solution 1

Solution 2


Regards

Pankaj


DatePickerClean.oml
2018-10-29 08-31-03
João Marques
 
MVP

Hi Pankaj,


To clear the input date, drag the client action DatePickerClearInputDate and set the InputId property to the Id of the input bound to the Date Picker, like the image below:


For more information, see OutSystems success documentation on the Date Picker.


Kind Regards,
João

UserImage.jpg
Pankaj Jain

Hi João Marques,

Thanks for response.

I tried your suggestion but still facing same issue. 


Regards
Pankaj


DatePickerClean2.oml
2018-10-29 08-31-03
João Marques
 
MVP

Hi Pankaj,


It does work, you just have to tweak it like the DatePickerOnSelect like the OML in attachment.


Kind Regards,
João

DatePickerClean2.oml
UserImage.jpg
Pankaj Jain

Hi João Marques,

Thanks for response.

In a way it is not completely fixed because the validation message is not displaying. 

Regards

Pankaj

2025-04-17 05-42-16
Ajit Kurane

Hello Pankaj,

If I understand your question well then,

Please find the demo here:

https://personal-xyog61l7.outsystemscloud.com/DatePickerClean/test?_ts=637769739141316203

I have updated your oml.

Regards,

Ajit Kurane.

DatePickerClean2.oml
UserImage.jpg
Johny William

Hello Pankaj,


You can target its class or id by query selector , add this to your  reset action in a javascript widget

"document.querySelector('your element Class or ID').value = '';"

Hope this will work for you !

Thanks & Regard
Tousif Khan

2026-01-07 08-26-33
Ram Kumar

To clear the text box, use the OutsystemsUI datepicker client action and pass the datepicker block id to it.

2022-10-10 12-36-34
Ross Jennings

NB: You must pass the id of the whole DatePicker / DatePickerRange block, not the id of the input box within the block.

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