- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 05:19 AM
We've got a Catalog Client Script that works without any problem for one catalog item (Record Producer).
When I use the same script for another catalog item it's not working though, it's not showing the confirm popup.
Any idea why I get this behaviour?
This is the script we use
function onSubmit() {
//Confirm popup to answer if an attachment has been attached.
var answer = confirm("INSERT TEXT HERE ABOUT CONFIRM POPUP");
if (answer == false) {
return false;
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 05:38 AM
Thanks for the help b-rad it's working now.
No idea why the first sript didn't work, I just made an insert of the previous script we had for another catalog item.
After recreating and using g_form it works.
function onSubmit() {
//Type appropriate comment here, and begin script below
if (g_form.getValue('kategori') == '-112') {
var answer = confirm("My Warning Text");
if (answer == false) {
return false;
}
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 05:29 AM
I would think this should work in both cases. Do you have 2 different client scripts? Can you confirm that the type on this one is onsubmit?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 05:31 AM
I recreated the Catalog Client Script (with exact same info) instead of using the previous one I inserted from another Catalog Client Script, and now it's working.
I want to add a condition from the Record Producer, how do I do this?
The popup should only appear if the Record producer variable "kategori" (a choice list) is "-112" (the value of the choice)
I tried with the following but it's not working
function onSubmit() {
//Type appropriate comment here, and begin script below
if (producer.kategori == '-112') {
var answer = confirm("Min varning");
if (answer == false) {
return false;
}
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 05:32 AM
producer.kategori would be server side and this CS is running client side so you need to use g_form. You should be able to replace it with g_form.getValue('kategori') == '-112'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 05:38 AM
Thanks for the help b-rad it's working now.
No idea why the first sript didn't work, I just made an insert of the previous script we had for another catalog item.
After recreating and using g_form it works.
function onSubmit() {
//Type appropriate comment here, and begin script below
if (g_form.getValue('kategori') == '-112') {
var answer = confirm("My Warning Text");
if (answer == false) {
return false;
}
}
}