I am using this oninput="setCustomValidity('')
on input
tag perfectly but it not seem to be working in a select
tag. Is this valid in select
tag?.
<select class="dropdownlist" required oninvalid="this.setCustomValidity('Please select Accused Name')" oninput="setCustomValidity('')">
Simply No, not valid for the select
The oninput()
is useful if you want to detect when the contents of a textarea
, input:text
, input:password
or input:search
element have changed, because the onchange
event on these elements fires when the element loses focus, not immediately after the modification.
So, use onchange()
as an alternative for the same!
Hope this will help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With