- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2015 08:01 AM
Hi All,
I have an onchange() script on the reference field , which works fine when I change the value of the field, but when I make the field blank by erasing the value, the onChange script wont get called.
So the check if(newValue == "") never gets called.
Thanks,
Uma
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2015 08:22 AM
Because it is returning out of the script. Take out the
|| newValue == ''
and it should work fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2015 08:10 AM
Can you post your script?
We were able to get it done just using:
if (newValue == '') {
g_form.setValue('configuration_item' , '');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2015 08:12 AM
Could you post your script where this isn't working? Changing the value of a reference field to blank should trigger the if(newValue=='') condition. Just tested it out to make sure and it's working in a demo instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2015 08:18 AM
Hi David,
It works fine, when the below code is not present, adding an alert after this line, is not working when I blank out the field.
if (isLoading || newValue == '') {
return;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2015 08:22 AM
Because it is returning out of the script. Take out the
|| newValue == ''
and it should work fine.