You need to write this function in the inline JS -
this.validateText = function(value){
var textView = this.ui.get("Text1");
var regExp = /^\d{4}$/;
if(value){
if(!regExp.test(value)){
textView.setValid(false, "Please enter 4 numbers");
}else{
textView.setValid(true);
}
}
}
Then call it from the on blur event of the textbox, like -
view.validateText(me.getData());
Hope this helps.
------------------------------
Atanu Roy
Solution Architect
Salient Process
------------------------------
Original Message:
Sent: Fri January 20, 2023 04:20 AM
From: YASEMİN ALADI
Subject: IBM BAW Plain Text Regular Expression
Hello,
I have a plain text field. In behaviour tab of plain text, there is regular expression. I wrote regular expression that accepts only 4 digit numbers. When I enter data which its length 5, error message is shown. Namely, regular expression is working. Error message is invalid format for content. Is there any way to change this error message?
Please help me. Thanks for your concern.
------------------------------
YASEMİN ALADI
------------------------------