function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue == '') { return; } g_form.hideErrorBox('user_email'); var pattern =/^[a-z0-9@.]{10,16}$/; // regex pattern if(!pattern.test(newValue)){ g_form.showErrorBox('user_email', getMessage('Alphanumeric with space allowed'));//show error messege g_form.setValue('user_email', ''); } }
Regex Should allow @ and . having a length of 10 to 16 characters
Working Code Asked question July 24, 2023