- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2016 01:04 PM
I get an error when using g_form.getOption() as an end user. It works fine as an admin, but the end user get the following error
My Client Script is triggered when the SMS checkbox is checked.
I've narrowed it down to this 2 rows in the script being the issue
var state_value = g_form.getValue('state');
var state = g_form.getOption('state', state_value).text;
If I remove them from the Client Script it'll continue to process without errors. It's the g_formgetOption being the issue here, but no idea what to do to get around this error. I've made a temporary solution to set the state variable to a hardcoded text based on the value of the state, but it's not a good solution in the long run (maybe states will change).
What I want to achieve is to get the Label of the state field and not the value.
It works fine as an admin but not as a user, I've checked so the user have a read-ACL on the state field, just to make sure.
Any idea what might be wrong?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2016 01:35 PM
instead of .text you should probably use .innerText in your second line of code, as text is not a propertie.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2016 01:31 PM
Check that the end user has permissions to change the field, usually via ACL.
harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2016 01:35 PM
instead of .text you should probably use .innerText in your second line of code, as text is not a propertie.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2016 01:48 PM
Thanks, it solved the issue