Why my onchange fonction(client script) not working for type encrypted text

djoodjii
Kilo Expert

Hi,

I create a field with type Encrypted Text, I add a client script (onchange) on that field, but my script it's not working.

EXp:

Hardware [alm_hardware]

function onChange(control, oldValue, newValue, isLoading, isTemplate) {

    if (isLoading ) {

    return ;

    }

  if(isNaN(newValue) ){

  g_form.showFieldMsg('u_4_digits','CC Digits must contain only digits','error');

  return false;

  }

  if(newValue.length!= 4){

  g_form.showFieldMsg('u_4_digits','CC Digits should be 4 digits','error');

  return false;

  }

 

}

Any Ideas!!!

Thanks

8 REPLIES 8

Mike Allen
Mega Sage

Are you in the context?   The form will not be able to see the value change if you are not.


Hi Mike,


What do you mean by the context?


thx


yes I'm, I follow this steps