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.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    How to make a datalist in javascript?

    How to make a datalist in javascript.
    Html datalist does not work in old browser so i want to make a
    datalist in javascript.please help me.

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    This is not the forum for questions. I'm sure a moderator will move this thread to the proper place, at some point. Just a heads-up.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,933
    Thanks
    79
    Thanked 4,424 Times in 4,389 Posts
    Did you see this example that shows how to provide a "workaround" for older browsers?
    http://www.quackit.com/html_5/tags/h...talist_tag.cfm

    The workaround needs some more done to it, but it does give one idea.

    Creating a true replacement is a real pain, though it can be done.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #4
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,981
    Thanks
    56
    Thanked 557 Times in 554 Posts
    but there are a million autocomplete scripts out there, if you care to google...

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,933
    Thanks
    79
    Thanked 4,424 Times in 4,389 Posts
    Well, yeah, but what is the fun in using somebody else's code? If I can't write it, why should I use it? <grin/>
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #6
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,373
    Thanks
    11
    Thanked 592 Times in 572 Posts
    Quote Originally Posted by Old Pedant View Post
    Well, yeah, but what is the fun in using somebody else's code? If I can't write it, why should I use it? <grin/>
    because something like this stops being fun about half-way to production-level quality.

    it's not so hard to get the textbox bound to a <select> instead of <datalist>, since they both use options, but that's where it stops being easy.

    inside the textbox, you have to handle the arrow keys and selection/focus as expected without sacking accessibility. that must work on mac and windows, ie and chrome, which are all variations.

    then you have to position the suggestion combo under the focused textbox, not always simple when float or position:fixed is in effect and don't forget about zooming/orientation changing the x/y offset between uses.

    then you figure out that IOS doesn't do multi-line <select>s, and now you have to write a custom <div> replacement, and all the keyboard-accessible focus/navigation handlers. for all those browser variations.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.6, IE11:9.1, IE9:3.1, IE10:3.0, FF:17.2, CH:46, SF:11.4, NON-MOUSE:38%


  •  

    Tags for this Thread

    Posting Permissions

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