I want to have a field in my form which is not required and can be left blank but if provided must be valid when compared to a predefined regex. I have added a validator to this field and the validator works fine when some string is input in the field.
The problem arises when user clicks on the field but clicks out without adding any text. In this case the field becomes invalid which is incorrect since it is not required.
I want to have a field in my form which is not required and can be left blank but if provided must be valid when compared to a predefined regex. I have added a validator to this field and the validator works fine when some string is input in the field.
The problem arises when user clicks on the field but clicks out without adding any text. In this case the field becomes invalid which is incorrect since it is not required.