Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oninput() not working on select

Tags:

html

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('')">
like image 895
user3266957 Avatar asked Mar 21 '14 15:03

user3266957


1 Answers

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

like image 165
Dhaval Marthak Avatar answered Nov 14 '22 23:11

Dhaval Marthak