0

Major issue i notice is when running javascript, weird things happen. For example, on input in text field, i want place placeholder. Usually, a simple jquery did the job and works well on desktop browser, including the mobile chrome browser, but not in the stock browser(Samsung default browers). after entering some characters the browser just stop all javascript processing. any one facing this issue...

<div class="holder">Email Address </div>
<input type="text" class="form-control" id="email" name="email" maxlength="45" value="" >

$("form input").each(function() {
        if ($(this).val()) {
            $(this).prev('.holder').hide();
        } else {
            $(this).prev('.holder').show();
        }
        $(this).on('input', function() {
            if ($(this).val() || $(this).text().length > 0) {
                $(this).prev('.holder').hide();
            } else {
                $(this).prev('.holder').show();
            }
        });
        $(".holder").click(function() {
            $(this).next().focus();
        });
    });

http://jsfiddle.net/thiru715/g263W/1/

Any one faces this issues please send me the solution......

user3915009
  • 49
  • 1
  • 1
  • 5
  • Why not just use the `placeholder=` attribute on the `input`? http://caniuse.com/input-placeholder – Evan Davis Aug 06 '14 at 15:42
  • Are you the same user as http://stackoverflow.com/users/1931467/user1931467 ? He posted the same code yesterday, and is also having trouble on Samsung. – Barmar Aug 06 '14 at 15:47
  • Hi Mathletics, i have a problem with placeholder i.e i focus on the text field, placeholder disables even not to wait enters the one character. except IE and stock browers others browsers work's fine. That's the reason i am writing the above functionality.... – user3915009 Aug 06 '14 at 17:21
  • Hi Barmar, yes i am the same person only. you find out the solution for that, if you find means please send to me also... – user3915009 Aug 06 '14 at 17:22

0 Answers0