Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to remove Ok/Cancel button in DatePicker?

MiłoszT
Tera Contributor

Hi, 
I cannot find a way to remove "Cancel" and "Ok" buttons from my form Datepicker.

MioszT_0-1762520225929.png

I see that in UI Builder component it is possible to remove those by deselecting "Show default footer actions":

MioszT_1-1762520237539.pngMioszT_2-1762520244001.png

But when editing form datepicker in FormBuilder I do not see any customization options.

Is there a way to make it so I do not need to first select date and then confirm it?
Thank you

 

1 ACCEPTED SOLUTION

AnjalPDijo
Giga Guru

Hi @MiłoszT, please note the following:

In UI Builder, you can remove the OK/Cancel buttons from the Date Picker by deselecting “Show default footer actions” in the component settings. This works because UI Builder uses configurable Now Experience components.

However, in Form Builder, the Date Picker is part of the standard platform form field and does not currently provide an option to hide these buttons. If you want this behavior, you would need to:

  • Use UI Builder for the form instead of Form Builder, or
  • Create a custom UI component for the date picker.

For more details, please refer to this discussion: https://www.servicenow.com/community/developer-forum/how-to-remove-ok-and-cancel-button-from-calenda... 

Regards,
Anjal

View solution in original post

3 REPLIES 3

AnjalPDijo
Giga Guru

Hi @MiłoszT, please note the following:

In UI Builder, you can remove the OK/Cancel buttons from the Date Picker by deselecting “Show default footer actions” in the component settings. This works because UI Builder uses configurable Now Experience components.

However, in Form Builder, the Date Picker is part of the standard platform form field and does not currently provide an option to hide these buttons. If you want this behavior, you would need to:

  • Use UI Builder for the form instead of Form Builder, or
  • Create a custom UI component for the date picker.

For more details, please refer to this discussion: https://www.servicenow.com/community/developer-forum/how-to-remove-ok-and-cancel-button-from-calenda... 

Regards,
Anjal

Ankur Bawiskar
Tera Patron
Tera Patron

@MiłoszT 

is the 1st screenshot from portal form?

But why to remove?

how will users then ensure the value they select actually gets set in that?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 
Thank you for the response.
Yes, it is from portal form.
The goal is to reduce number of clicks needed to select the date. I think that many datepickers offer this functionality, even in different parts of ServiceNow, like UI Builder or record form, so users do not necessarily have to ensure the value they selected is correct.

Thank you,
Miłosz