- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2023 12:16 PM
I have a catalog item that I'm trying to restrict users from submitting if the request is for themselves. In my client script I am comparing 2 fields. If the name is the same in both fields, the alert is triggered referring them to their manager. That piece seems to be working. If the 2 fields are different, they should be able to continue with the request. But when the 2 fields are different the alert is still being triggered. I'm fairly new when it comes to JavaScript, any help/suggestions would be appreciated. I have attached my script. Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2023 11:03 AM
So you are seeing the alert window (for the variable value), but it is empty, or does it say 'undefined' or 'null'? Have you confirmed that these are exactly the names of the variables - case-sensitive and no trailing space or anything like that? Since this is onChange, you can use newValue for the request_access script variable, or in the if condition. It would be super weird if you alert on newValue and it is empty, after having selected a user in the reference field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 04:28 AM
Ah - that could drive you crazy until you see it. Glad to hear it's working for you now.
Connect with me https://www.linkedin.com/in/brad-bowman-321b1567/