Search the Community
Showing results for tags 'accent'.
-
Hi, I'm trying to fake the placeholder attribute for a contact form using jQuery. To do so, I placed an input on top of a label tag (which is basically the value I want inside the input), and used jQuery to hide the label when pressing a key and show it back when the field is empty. I used the keypress and keyup events, like so: jQuery(function($){ $(".placeholder").each(function(){ var label = $(this).find("label"); var input = $(this).find("input"); […] input.keypress(function(){ label.stop().hide(); }); input.keyup(function(){ if(input.val() == ""){ label.stop().show(); } […] }); It works just as expected except if I start filling the input out with accents/diacritical signs which will just write on top of my label until I end up pressing a key that doesn't take accents. Is there any chance to fix this issue? Ideally, I would like to make my label disappear when pressing any key. Thanks for your help. Edit: just added an example here https://jsfiddle.net/0kfp10Lf/3/ The label doesn't hide if I start filling out the input with any of the following keys ~ ^ ¨ ` ´, whether I combine them or not with a a, e, y, u, i, o or n. Otherwise, everything's fine.