validation - How do I suppress jQuery warnings for invalid email address? -


i'm using jquery 2.2.0, , css targeting i'm updating value attribute equal value of input on input events. using type of "email" results in jquery warning in console every time event fires, unless it's valid email. warning shows when updating value attribute directly.

the specified value "foo" not valid email address. -> jquery.min.js:3

is there way temporarily suppress or disable warning? open console , input rendered snippet below see.

$('input').on('input', function () {    $(this).attr('value', $(this).val());  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>    <input type="email">

that's not jquery warning html5.

when put invalid email value <input type="email" value="a"> it's gonna throw warning because not valid email address.

so said function forcing put introduced value value attribute, refresh dom , make validation every time user introduce text.

try in fiddle

<input type="email" value="a">

and you'll see warning.

you don't need put introduced value in value attribute, can using $('input').val() or instead use <input type="text"> , validation jquery , regex.


Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -