- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2024 07:31 PM
I'm trying to block a item from being submitted if they state its not an Emergency by selecting No.
I need it to Block which its doing but I need it to clear the 2 fields and that is not working.
It worked 1 day and stopped the next
What is wrong here? and will this work in the portal?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2024 08:18 PM
If you want to clear variables and also abort the submission if emergency variable is No then you should not have two return false statements in your client script.
You can move clearValue statements also to the If block and remove return false statement from line no-5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2024 08:33 PM
Hi @Tom Thompson To achieve your requirement, you need to add a --None-- option
Use below code
var emergencyExit = g_form.getValue('add_providers_emergency_request');
if (emergencyExit == 'No') {
alert("Testing");
g_form.clearValue('emergency_exit');
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2024 10:06 PM
I tried this it showed error but did not clear values.. Not sure what emergency exit field is.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2024 10:27 PM
Hi @Tom Thompson use to clear Emergency Request field according to your requirement clearValue('add_providers_emergency_request');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2024 08:15 PM - edited 09-18-2024 08:18 PM
Need to clear the date field 'When do you need this work done' and the emergency
not sure what you mean?
If it's Choice field you need to use backend value of No choice option in getValue() API