Hi, I’m building a form bymyself using seperate input fields.
Most of my input fields have pattern validation (regEx) in it which is sufficient validation for me so no use to need the onCustomValidation function.
The problem is as follows - user inputs data - onChange event is trrrigered → validity of the field is polled (with slight delay) → if TRUE → resetValidityIndication & updateValidityIndication are called - but field still shows the red indication (invalid input)
Field validated type: Phone Number
Pattern Validation:
^0\d([\d]{0,1})([-]{0,1})\d{3}([-]{0,1})\d{4}$
see code below:
export function inpPhoneNo_change(event) {
setTimeout(() => {
console.log("REGULAR VALIDATION" + $w("#inpPhoneNo").valid)
//if ($w("#inpPhoneNo").value.length >= 10) {
// console.log("PHNONE > 10")
if ($w("#inpPhoneNo").valid) {
$w("#inpPhoneNo").resetValidityIndication()
$w("#inpPhoneNo").updateValidityIndication()
console.log("PHONE VALID")
$w("#txtPhoneErr").hide("fade", fadeOptions)
detailsValidArr[phone] = true
} else {
console.log("PHONE IN -- VALID")
$w("#txtPhoneErr").show("fade", fadeOptions)
detailsValidArr[phone] = false
}
detailsBoxValidation(detailsValidArr)
//}
}, 100);
}
BTW, already tried to change the input type to text or just Number - same resutls.
Thanks,