The Zurich release has arrived! Interested in new features and functionalities? Click here for more

alert on onchange Multiline text

snow57
Tera Contributor

HI,

 

i just want to create a alert on when ever the multiline text changes (onchange multiline text variable). The below code is keep on looping again. i added "return" to stop the loop but its not working. could some one help me to stop the loop?

script:

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }
 
if(newValue!= oldValue){
/
    alert("test the multile text");
    return;
}
 
 
}
 
Thanks
1 REPLY 1

Danish Bhairag2
Tera Sage
Tera Sage

Hi @snow57 ,

 

Do you need to compare the text as well whenever it changes & then display the alert or its just whenever the value is entered in the field whether its same or diff it should display an alert?

 if its the later case no need of newValue oldValue check just put an alert.

 

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }
 
if(newValue != oldValue){
    alert("test the multile text");
}
 
 
}

 

Also if above thing not work can u share some snip please.

 

Thanks,

Danish