Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-05-2012, 05:06 PM   PM User | #1
AA Haider
New to the CF scene

 
Join Date: Oct 2012
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
AA Haider is an unknown quantity at this point
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.
AA Haider is offline   Reply With Quote
Old 10-05-2012, 05:46 PM   PM User | #2
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 952
Thanks: 7
Thanked 98 Times in 98 Posts
WolfShade is an unknown quantity at this point
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".
WolfShade is offline   Reply With Quote
Old 10-06-2012, 01:16 AM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,248
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Old 10-06-2012, 01:52 AM   PM User | #4
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 454 Times in 452 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
but there are a million autocomplete scripts out there, if you care to google...
xelawho is offline   Reply With Quote
Old 10-06-2012, 03:01 AM   PM User | #5
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,248
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Old 10-06-2012, 03:54 AM   PM User | #6
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,469
Thanks: 9
Thanked 466 Times in 450 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
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 5/13)
STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%
rnd me is offline   Reply With Quote
Reply

Bookmarks

Tags
html, javascript

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:58 PM.


Advertisement
Log in to turn off these ads.