- 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:47 PM
Hi , check the data type of the field. If it's a choice list check the value for the choice . Hopefully that should be the issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2016 02:54 PM
ok alert sill not firing but it IS setting the fields to null and No
variable onChange: foo
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//if foo is no set bar to No and hide foo
if(newValue == 'No'){
alert(getMessage('this is my alert'));
g_form.setValue('bar' , 'No')
g_form.setValue('foo' , '') //set field to null UI script hides foo when bar is No
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2016 02:58 PM
Just remove that foo line and try. You are still changing the foo value from No to ''
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//if foo is no set bar to No and hide foo
if(newValue == 'No'){
alert(getMessage('this is my alert'));
g_form.setValue('bar' , 'No')
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2016 01:57 PM
Are either of the setValues changing the value of the variable that has the onChange script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2016 02:23 PM
yes, thats the weird part its is setting the values. I actually accidentally had the below (was changing it over from a field msg to an alert and was going too fast ) and it popped up u_field in the alert but got in an endless loop
alert('u_field','test','info');
