this post was submitted on 27 Jan 2024
7 points (100.0% liked)
JavaScript
2003 readers
1 users here now
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Usually validation is only triggered on change or blur events. Changing the value programmatically doesn't trigger these events so you need to trigger them yourself.
Thank you @[email protected] that exactly my question.. how can I trigger the validation process again ?
Try
form.reportValidity()
where form is the form element.