Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,189
    Thanks
    10
    Thanked 569 Times in 550 Posts
    Quote Originally Posted by Philip M View Post
    A good example of a bell/whistle which does not really add anything significant to the ux (as rnd me calls it). IMO. We could still live without it.
    using the placeholder means you don't need a <label> with redundant text around the input. On mobile especially, where space is at a premium, using placeholder (or a legacy fallback) dramatically reduces on-screen clutter and allows a less disorienting next input scroll on iOS.

    unlike label, placeholder typically gives an example instead of direction, which a lot of folks find more instructive.
    for example, (Zip: [ ]) versus ([ 90210 ]). I can tell at a glance of the placeholder that i don't need my 9 digit zip answering a question before moving the mouse.

    one last advantage of placeholder: when combined with the list attrib, you have an indeterminate combo box instead of one with a default value.

    the little scripts that try to replicate placeholder end up being quite long, and usually don't mimic the same behavior exactly. Because it's such a nice design pattern, and because the scripting to replicate it is tedious and fragile, they added it to HTML5.

    you don't have to use HTML5, i'm sure HTML3 still shows up. It's just that they've added such features after listening to the demands of programmers. It's not all about new capabilities, a lot of it is simply removing all the time-consuming tedium and debugging to do simple things like providing an example value on a form input.

    If you like hand-coding because it's fun go ahead, it will work forever. Or, maybe you want the deck chairs of a titanic like IE8 to be comfortable for the next several months while the ship sinks... more power to you.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/1/19) IE7:0.2, IE8:6.7, IE11:7.4, IE9:3.8, IE10:4.4, FF:18.3, CH:43.6, SF:7.8, MOBILE:27.5

  2. #17
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,733
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    rnd me - I am prepared to accept that HTML5 has clear advantages on mobile browsers.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


 
Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •