Hi all,
I want to make a field named "KdAufPos" visible, if another field named "Kontierungselement" (text field) has the character length 7.
I am using the following javascript code in the change event of the Kontierungselement field:
console.println("START ");
var currentLength = this.rawValue.length;
var kdAufPos = FormServiceRequestConfirmation.mstPageSet1.mstPage1.frmTitle.KdAufPos;
console.show();
console.println("currentLength "+ currentLength);
validateFieldValueLength(currentLength);
function validateFieldValueLength(currentLength){
if (currentLength == 7 ){
console.println("zeichenlänge momentan " + currentLength);
kdAufPos.presence = "visible";
}else{
console.println("KdAufNr ist nicht leer " + currentLength);
}
}
My issue is that the change event is not triggering correctly. After I am opening the PDF and entering data in the field, the console is showing up but don't display my console.println - I got an error with "TypeError: this.rawValue is null".
Just after exit the field and click in again, I got the console.println and got displayed sometimes the right and sometimes the wrong length...
What is this error about? Why is it that after clicking out and in again the script seems to work and at least do something?
Any tips?
Thanks a lot!
Regards
Deborah