Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Newbie

0 views
Skip to first unread message

winst...@gmail.com

unread,
Jul 7, 2006, 4:41:13 PM7/7/06
to
Hi GUys

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

Evertjan.

unread,
Jul 7, 2006, 5:03:12 PM7/7/06
to

Impossible.

What ia a dropdown arrow?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Tom Davis

unread,
Jul 7, 2006, 6:02:01 PM7/7/06
to

Evertjan. wrote:
> Impossible.
>
> What ia a dropdown arrow?

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.

unread,
Jul 7, 2006, 6:32:41 PM7/7/06
to
Tom Davis wrote on 08 jul 2006 in comp.lang.javascript:

>
> Evertjan. wrote:
>> Impossible.
>>
>> What is a dropdown arrow?

Cross browser? I doubt it.

What is a dropdown arrow?

Randy Webb

unread,
Jul 7, 2006, 7:10:16 PM7/7/06
to
Tom Davis said the following on 7/7/2006 6:02 PM:

> Evertjan. wrote:
>> Impossible.
>>
>> What ia a dropdown arrow?
>
> This isn't really impossible at all,

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/

Jim Land

unread,
Jul 7, 2006, 11:47:27 PM7/7/06
to
winst...@gmail.com wrote in news:1152304873.359742.132110
@m79g2000cwm.googlegroups.com:

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.
>

TheBagbournes

unread,
Jul 8, 2006, 12:13:43 PM7/8/06
to

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.

Randy Webb

unread,
Jul 8, 2006, 1:30:56 PM7/8/06
to
TheBagbournes said the following on 7/8/2006 12:13 PM:

> Jim Land wrote:
>> winst...@gmail.com wrote in news:1152304873.359742.132110
>> @m79g2000cwm.googlegroups.com:
>>
>>> Hi GUys
>>>
>>> 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.
>>
>> 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.

Prove it.

> The <select> z-index problem is an IE6 bug.

Nonsense.

Lasse Reichstein Nielsen

unread,
Jul 8, 2006, 1:51:05 PM7/8/06
to
Randy Webb <HikksNo...@aol.com> writes:

[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.'

Matt Kruse

unread,
Jul 8, 2006, 5:35:22 PM7/8/06
to
Lasse Reichstein Nielsen wrote:
> Do you really miss Thomas this much? :)

Speaking of him, where did he go?

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com


Randy Webb

unread,
Jul 8, 2006, 10:15:09 PM7/8/06
to
Lasse Reichstein Nielsen said the following on 7/8/2006 1:51 PM:

> Randy Webb <HikksNo...@aol.com> writes:
>
> [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? :)

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.

Randy Webb

unread,
Jul 8, 2006, 10:17:36 PM7/8/06
to
Matt Kruse said the following on 7/8/2006 5:35 PM:

> Lasse Reichstein Nielsen wrote:
>> Do you really miss Thomas this much? :)
>
> Speaking of him, where did he go?
>

Shhhh, he might come back :)

But it does make one curious.

Kevin Darling

unread,
Jul 9, 2006, 3:30:07 PM7/9/06
to

winst...@gmail.com wrote:
> 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.

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

Dr John Stockton

unread,
Jul 11, 2006, 9:32:18 AM7/11/06
to
JRS: In article <7j2oc7...@hotpop.com>, dated Sat, 8 Jul 2006
19:51:05 remote, seen in news:comp.lang.javascript, Lasse Reichstein
Nielsen <l...@hotpop.com> posted :

>
>Do you really miss Thomas this much? :)

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.

0 new messages