Restrict submission of catalog item if the url in the help text is not clicked

RanjanRP
Tera Contributor

Is there a way to prevent submitting a catalog item unless the user clicks a URL in the help text?

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@RanjanRP 

You can have this approach

1) create a hidden checkbox type variable and place it at the end of catalog form and hide it using UI policy

2) use variable of type Custom and create a widget to show that URL, in HTML of that anchor tag add onclick even and then update that hidden checkbox as true once link is clicked.

3) use onSubmit catalog client script and see if checkbox is true, if yes then allow submission, if not then stop submission

This is the widget syntax to set the variable from widget client controller

api.controller = function($scope) {

$scope.page.g_form.setValue('hiddenVariable', true);


});

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

@RanjanRP 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

12 REPLIES 12

@RanjanRP 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

RanjanRP
Tera Contributor

Thanks @Ankur Bawiskar  that worked.

@RanjanRP 

Glad to help.

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