PopUp/Alert Record Producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 12:43 PM - edited 09-25-2023 12:50 PM
Hi,
I am trying to figure out the best way to create a pop-up/alert box with text and an okay button inside a record producer on the form as a customer is selecting 2 fields that meet 2 separate criteria.
I need to have it based upon 2 values
1. If it's a certain location
AND
2. If it's certain categories
Both must apply.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 12:55 PM
Hi @Elizabeth26 ,
You can look at the below code :
function onSubmit() {
//Type appropriate comment here, and begin script below.
var loc = g_form.getValue('location'); // enter proper backend name of ur variable.
var cat = g_form.getValue('categories')//enter proper backend name of ur variable.
If (loc == 'desiredValue' && cat == 'desiredCat'){
var answer = confirm('Enter desired text');
}
// use this if u want to restrict users from submitting it they press cancel
if(!answer){ // if cancel is pressed it will not allow the record producer to submit
return false;
}
}
Please mark my answer helpful & accepted if it helps you resolve your query.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2023 12:50 PM
It appears it does not work because I am unable to dot walk to the parent field I need to trigger off of in the catalog client script.
Is there a way around this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 12:01 AM - edited 09-26-2023 12:03 AM
Hello @Elizabeth26 ,
You can try it by creating catalog client script.
Type = On Submit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 01:22 PM
I tried this but it did not trigger on submit.