I have the following HTML code:
<form role="search" id="searchform" action="/search" method="get">
<input value="" name="query" type="search" placeholder="" required="" pattern="^[a-zA-Z_0-9\s]+$">
<button type="submit"><i class="ion ion-ios-search"></i></button>
</form>
and Javascript code:
document.getElementsByName("query")[0].oninvalid = function (ev) {
ev.preventDefault();
ev.target.setCustomValidity( 'Only numbers, letters and space are allowed !' );
}
Seems that work only in Firefox, Chrome and Safari but not in Internet Explorer 11.
Not working mean that appear standard message like: You must use this format:
What I missed ?