Live validation of a required field
Hi. I want my form to validate a field after it's blurred. One of the validation rule is ->required().
This is the code:
This works well for the other rules (such as unique), but not for the required rule.
It kind of makes sense, as the field is initially empty and is not updated before it's blurred.
It does, of course, work if the user changes the input field but leaves it empty.
But is there a way or a workaround to make it work when the user did not change
the field after it's blurred?
Thank you in advance.
This is the code:
This works well for the other rules (such as unique), but not for the required rule.
It kind of makes sense, as the field is initially empty and is not updated before it's blurred.
It does, of course, work if the user changes the input field but leaves it empty.
But is there a way or a workaround to make it work when the user did not change
the field after it's blurred?
Thank you in advance.