- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2016 01:52 PM
i have a onChange catalog client script that DOES change the field values so it is running but it doesn't throw the alert.
if(newValue == 'No'){
alert(getMessage('test'));
g_form.setValue('foo' , 'No')
g_form.setValue('bar' , 'No')
}
--or
if(newValue == 'No'){
alert('test');
g_form.setValue('foo' , 'No')
g_form.setValue('bar' , 'No')
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2016 06:53 AM
clear cache and check to clear form data and that should resolve that part of it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2016 02:25 PM
can you post your entire code. Make sure that you do not have any other client scripts that is setting the values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2016 02:32 PM
thats literally all I am doing in the onChange. If a foo value is No i am popping an alert and changing the foo and bar no. I do have some UI policies that hide the fields. foo is the trigger for the on change when this field is No I am throwing an alert and changing foo and bar to No. If bar is No a UI policy hides foo. I tried reversing the foo and bar setValues (but didnt think that would matter)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2016 02:36 PM
Why are you setting foo again. This will trigger the same onchange script again and will be caught in a endless loop. Can you remove that line just set bar value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2016 02:43 PM
ok wow! i meant:
if(newValue == 'yes')
GEEEEEZ!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2016 02:47 PM
wait wait...... newvalue is foo, and if thats no bar sets to no hides foo and i should get the alert
- if(newValue == 'No'){
- alert('test');
- g_form.setValue('foo' , '')
- g_form.setValue('bar' , 'No')