Alert not firing on onChange client script

sigmachiuta
Kilo Guru

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')

   

      }

1 ACCEPTED SOLUTION

clear cache and check to clear form data and that should resolve that part of it.


View solution in original post

39 REPLIES 39

can you post your entire code. Make sure that you do not have any other client scripts that is setting the values.


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)


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


ok wow! i meant:


if(newValue == 'yes')



GEEEEEZ!


wait wait...... newvalue is foo, and if thats no bar sets to no hides foo and i should get the alert



  1. if(newValue == 'No'){  
  2.       alert('test');  
  3.       g_form.setValue('foo' , '')  
  4.       g_form.setValue('bar' , 'No')