- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 01:20 AM
Hi I was hoping someone could help with an onSubmit() client script?
The script is to prevent a catalog item from being submit if a boolean variable is false with a simple alert.
I get the alert and the the item won't allow me to submit which is what it should do but if the variable is true then
it still behaves like it's false. The script is below. I've tried else, else if with a return true but that just cancels out the return false. Script below:
function onSubmit() {
//Type appropriate comment here, and begin script below
if (atgm_user == 'no') {
alert ('You cannot submit this request if you are not an ATGM user.');
return false;
}
}
Any help greatly appreciated 😊
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 09:34 AM
The syntax on both looks fine. Let's temporarily add an alert at the beginning to answer the question of what value is detected for this test case:
function onSubmit() {
var atgm = g_form.getValue('atgm_user');
alert(atgm);
if (atgm == 'false') {
alert(getMessage('You have to be an ATGM user in order to use PDMLink with CREO. You cannot submit this request if you are not an ATGM user.'));
return false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 05:18 AM
You are welcome!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 01:41 PM
.