Asking the *Impossible* for an HTML Form Control
Dear respected members of the Webmaster Forums,
I'd like to ask if anyone can come up with a creative way to accomplish the following:
- have an input text box AND
- have a dropdown list
... into ONE.
[ I would post a screenshot - but I guess a better example would be the Start > Run "combo-box" available from WinXP ]
Yes, it's asking a lot. I don't even know if this is possible. I've seen it done in M$ applications but haven't seen one in a web form.
If it turns out to be impossible, can you please explain or provide a "proof" of why it's not possible? Also, if you have an alternative using Javascript/DHTML or some other way, can you please point me in the right direction?
Thanks so very much and have a wonderful Christmas everyone (it's only 10 days away)!!
Busy posted this at 07:51 — 16th December 2005.
He has: 6,151 posts
Joined: May 2001
Hi, what you see in start/run is an overflow of the input field (previous chosen items, like in your tool bar address bar)
The input box uses the input tag
The drop down uses the select tag
JeevesBond posted this at 18:49 — 16th December 2005.
He has: 3,956 posts
Joined: Jun 2002
Am afraid the answer is a firm no to this one, not unless you can find some amazing JavaScript trickery (very inadviseable and really really really not worth the effort due to the accessibility issues it'll cause).
This functionality isn't built into forms at the moment. Sorry.
a Padded Cell our articles site!
JeevesBond posted this at 18:50 — 16th December 2005.
He has: 3,956 posts
Joined: Jun 2002
And Happy Christmas to you too!
bja888 (not verified) posted this at 04:12 — 17th December 2005.
They have: 5,633 posts
Joined: Jan 1970
I started working on it... (the javascript)
I can make it so it is cross browser but you there is no way is JavaScript or CSS is turned off.
On the other hand... The best way to do it would be Javascript/Flash combo
triapply posted this at 03:11 — 21st December 2005.
He has: 14 posts
Joined: Sep 2005
Thanks to the helpful folks that responded! In particular,
JeevesBond - Thanks for the confirmation. I know now I was just imagining things =).
bja888 - Great to hear! Please update me and everyone else on your progress! Although I dont' think I can implement anything non-trivial in Flash =)
I've started to implement a workaround (google suggest style) to see if I can use a regular text input field with the suggest-like feature attached to the bottom as the user starts to type in the text field.
Thanks again!
lex posted this at 19:03 — 21st December 2005.
They have: 96 posts
Joined: Jul 2005
I seen it done in flash
bja888 (not verified) posted this at 23:22 — 23rd December 2005.
They have: 5,633 posts
Joined: Jan 1970
Sorry, I have kinda been on an unexpected hiatus.
If you want a button to expand/hide results thaen it needs done in flash but if you just want a text area with options then it can be done in JavaScript.
dk01 posted this at 23:42 — 23rd December 2005.
He has: 516 posts
Joined: Mar 2002
This can be done with AJAX. Its a combination of dhtml and serverside components. It works in FF and IE 5.5+ at least. Basically you create a connection to the server when the page is loaded. This connection can be worked over without having to reload the page. So it works kind of like Gmail does. This is just one AJAX example:
http://www.yourhtmlsource.com/examples/ajaxformsubmission.html
and the tutorial for that form:
http://www.yourhtmlsource.com/javascript/ajax.html
And this one example here is very complex. Try typing in a first name like bob or jim. It will update without reloading the page:
http://www.farleyfamily.net/school/project/client/
You can learn more on AJAX on the wikipedia page. Anyhow this is all quite complex and may not be worth doing unless you know your stuff and are fluent in php, mysql, and javascript. Anyhow its possible though!
Jim
bja888 (not verified) posted this at 01:29 — 24th December 2005.
They have: 5,633 posts
Joined: Jan 1970
Thank you for a shove in the wrong direction dk01.
Filling it with content will be the easy part. Getting the html to work is the hard part.
dk01 posted this at 10:16 — 24th December 2005.
He has: 516 posts
Joined: Mar 2002
:jump:
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.