.value.contains doese'nt works in some browsers.
Hello,
I have a form like this:
- <input type="text" name="url"><br>
<input type="submit" value="submit">
and I wrote this jQuery code to prevent submit form if field has a certain value:
- $(document).ready(function(){
$('input[type="text"').keyup(function(){
if(this.value.contains('text')){
alert('Sorry, we can\'t submit '+this.value+' here!');
$('input[type="submit"]').remove();
}
});
});
but it works only in firefox and not works in chrome and IE.
see this demo please:
http://jsfiddle.net/sabeti05/mv5kpxLj/