Alternative of return false on client side to restrict form submission
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2023 08:41 AM
We have a form in which user can enter values in 2 list fields. Now, we have to set-up validation on those field that if field 1 has certain values then field 2 mandatorily should have relevant related values, else we have to restrict them from submitting the form.
I tried this with client script and tried using return false to restrict the user from submitting the form.
--> When user is clicking on save/update the client script is correctly aborting the action. But when the user is clicking on a different UI action button on the same page, the UI action is invoking a UI page, which in turn is writing to the same table on which I have written the client script. Is there any way we can restrict all actions being taken on click of that button? something on the line of e.preventDefault() maybe?
Note: I can't use BR in this scenario, because of some other reason, hence checking if there is any better way other than client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2023 08:52 AM
Hi @Nikhil65
I don't think that there is an option you have in mind because you are only have ONE user interface in mind. But what about Service Portals, Workspaces, Mobile Apps? Therefore, you always can only control what is possible in one single client script.
Instead to achieve your requirement you would have to implement something similar to a checkout feature (as you have it for example in the Catalog Builder)
Maik