I am new to javascript and would like to know if the following is
possible:
I want to create a dropdown and place a text input(editbox) on top of
that dropdown in such a way that only the dropdown arrow shows. What
I am actually trying to achieve is to have a dropdownbox in which the
user can type in its own value if not in the drop down list.
thanks
Impossible.
What ia a dropdown arrow?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
This isn't really impossible at all, you just can't use the standard
html <select> box to do it if you want the input box covering the
dropdown. Actually with some creative positioning you might even be
able to do that, but I don't know how (if at all) usable it would be.
Basically, the gist of it is this: have an input box that has a
listener on the form button (or just wait for ENTER), it then appends
whatever you put there into an "invisible" div that will appear when
you click on the select dropdown arrow, then add a listener on the list
elements so you know which was clicked, or make them submit a form.
So to answer your questions, yes it is possible.
>
> Evertjan. wrote:
>> Impossible.
>>
>> What is a dropdown arrow?
Cross browser? I doubt it.
What is a dropdown arrow?
Yes it is.
> you just can't use the standard html <select> box to do it if you want
> the input box covering the dropdown.
Then it can't be done as asked as the OP specified a <select> (if you
can understand the gibberish wording of the question).
> Actually with some creative positioning you might even be able to do that,
> but I don't know how (if at all) usable it would be.
Considering that a <select> is a windowed component in IE and that
z-index has no effect on it, what you are saying might be possible is in
fact impossible.
> Basically, the gist of it is this: have an input box that has a
> listener on the form button (or just wait for ENTER), it then appends
> whatever you put there into an "invisible" div that will appear when
> you click on the select dropdown arrow, then add a listener on the list
> elements so you know which was clicked, or make them submit a form.
Show some actual sample code that attempts to do what you are implying
might be able to be done.
> So to answer your questions, yes it is possible.
No, it's not.
What is a "dropdown arrow" though?
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Perhaps you are thinking of a "Combo Box" which some GUIs use. It allows
the user to either select an item from the dropdown menu, or type text
into a text box. JavaScript doesn't have a built-in Combo Box control.
It's debatable whether you can create one using other JS controls.
>
Of course you can create a control to do this. The <select> z-index problem is an IE6 bug.
You could develop a good control easily with http://developer.yahoo.com/yui/ which has good cross-browser capabilities.
Prove it.
> The <select> z-index problem is an IE6 bug.
Nonsense.
[Combo box]
>> Of course you can create a control to do this.
>
> Prove it.
The examples of successful combo boxes I have seen have not used
select controls (and my feeble attempts at doing so all failed
miserably). The control is possible, but the implementation strategy
(using a combination of text control and select control) is unlikely
to work, especially across different browser (where the "down arrow
button" will probably have different widths, and there is no way to
find it).
>> The <select> z-index problem is an IE6 bug.
>
> Nonsense.
Do you really miss Thomas this much? :)
It's true that the problem exists in other browsers than IE too.
Whether it's a bug or a feature, I'll leave to the philosophers.
/L
--
Lasse Reichstein Nielsen - l...@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Speaking of him, where did he go?
--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Ugggh....
Point made though.
> It's true that the problem exists in other browsers than IE too.
That was precisely my point. Not well made but that was the point. It is
in IE4+ IIRC.
> Whether it's a bug or a feature, I'll leave to the philosophers.
Ditto.
Shhhh, he might come back :)
But it does make one curious.
Two seconds of Googling found several attempts at creating an HTML
combo box. The best one seems to be at:
http://particletree.com/features/upgrade-your-select-element-to-a-combo-box/
Cheers,
Kev
Now would be a good time to kill-rule Thomas Lahn, since if he returns
he'll probably post several thousand articles.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.