473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

write into drop down box- Possible ????

I was just wondering, is it possible to write into the drop down box in
order to jump to a specific item. The reason why I am asking is my drop down
box has many items and additionally to the scrolling down, it would be good
if the user can write into the box in order to get the specific entry the
list selected.
Is this possible ?
Thanks.
Jul 20 '05 #1
6 9305
Hello,
Sure, you can add new items to the listbox:

<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>

<body>
<script>
function addEntry(frm)
{
frm.s.options[frm.s.options.length] = new Option(frm.t.value,
frm.t.value);
}
</script>
<form name='f'>
New entry:<input type='text' value='[value]' name='t'><input type='button'
onclick='addEntry(this.form);' value='add entry'>
<br>
Listbox:
<select name='s'>
<option value='line1'>Line1</option>
</select>
</form>
</body>
</html>

"Filiz Duman" <no**@aol.com> wrote in message
news:bu**********@visp.bt.co.uk...
I was just wondering, is it possible to write into the drop down box in
order to jump to a specific item. The reason why I am asking is my drop down box has many items and additionally to the scrolling down, it would be good if the user can write into the box in order to get the specific entry the
list selected.
Is this possible ?
Thanks.

Jul 20 '05 #2

"lallous" <la*****@lgwm.org> wrote in message
news:bu************@ID-161723.news.uni-berlin.de...
Hello,
Sure, you can add new items to the listbox:

<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>

<body>
<script>
function addEntry(frm)
{
frm.s.options[frm.s.options.length] = new Option(frm.t.value,
frm.t.value);
}
</script>
<form name='f'>
New entry:<input type='text' value='[value]' name='t'><input type='button'
onclick='addEntry(this.form);' value='add entry'>
<br>
Listbox:
<select name='s'>
<option value='line1'>Line1</option>
</select>
</form>
</body>
</html>

"Filiz Duman" <no**@aol.com> wrote in message
news:bu**********@visp.bt.co.uk...
I was just wondering, is it possible to write into the drop down box in
order to jump to a specific item. The reason why I am asking is my drop down
box has many items and additionally to the scrolling down, it would be

good
if the user can write into the box in order to get the specific entry the list selected.
Is this possible ?
Thanks.


Thanks, but I did not mean writing in the sence of entering a new item into
the drop down box. I meant writing in the sence of entering the first letter
and then the second etc. and with this I would jump to that specific item
directly rather then scrolling to it ! (Mainly needed because my list is
quite long, so the user should have the possiblity to jump to the item
rather then scrolling all items in the drop down list !)


Jul 20 '05 #3
"lallous" <la*****@lgwm.org> wrote in message
news:bu************@ID-161723.news.uni-berlin.de...
<snip>
frm.s.options[frm.s.options.length] = new Option(frm.t.value,

<snip>

Though there is at leas one current browser that lakes the Option
constructor so it would be a good idea to check it exists prior to using
it (and consider the consequences of a design that requires it).

Richard.
Jul 20 '05 #4
On Wed, 21 Jan 2004 10:31:20 +0000 (UTC), Filiz Duman <no**@aol.com> wrote:
I was just wondering, is it possible to write into the drop down box in
order to jump to a specific item. The reason why I am asking is my drop
down box has many items and additionally to the scrolling down, it
would be good if the user can write into the box in order to get the
specific entry the list selected.


A SELECT element is a drop-down menu, or list box, only. You can only type
in INPUT and TEXTAREA boxes. In general, pressing a key in a drop-down
menu will take you to the first option that begins with that character[1].

The best you do, reliably, is make access easier for your users through
organisation. A couple of ideas...

- If possible, group items into catagories, and order them alphabetically,
numerically, or by some other logical order.
- If there are distinct groups, use two menus. The first should hold the
catagories. The second is then populated when a catagory is selected. This
can be done with JavaScript, but a non-JavaScript alternative (usually
implemented server-side) must be provided whenever possible[2].

Mike

[1] That isn't guaranteed behaviour.
[2] In fact, implementing this style *properly* could be quite involving.

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #5
I have read the following message from "Filiz Duman" <no**@aol.com>
and have decided to lend my vast knowledge.

<snip>

Thanks, but I did not mean writing in the sence of entering a new item into
the drop down box. I meant writing in the sence of entering the first letter
and then the second etc. and with this I would jump to that specific item
directly rather then scrolling to it ! (Mainly needed because my list is
quite long, so the user should have the possiblity to jump to the item
rather then scrolling all items in the drop down list !)


and my reply is:
If you change your drop down box to a scrolling list (make lines
greater than 1) it will automatically scroll when you type a single
letter. At least it does on my browser. You first select the first item
in the list and then type a letter.

The only problem is when you select the first item an onchange event
takes place. You may need a separate button to activate the selection.

See my Amtrak page at my web site http://www.dcs-chico.com/~denmarks/

There is a list of hundreds of stations and it will scroll with no
special coding after selecting the first item.

--
Dennis M. Marks
http://www.dcs-chico.com/~denmarks/
Replace domain.invalid with dcsi.net
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 20 '05 #6
Yes, I would think you can just add an input text box to go along with
your drop-down box, and then everytime a key is pressed in the text box, use
a javascript loop to look thru the drop-down box's options[i].text for a
match with what is currently contained in your text box. If it finds a
match, then set that matching option[i].selected to "true" and it will
automatically scroll to the newly selected option[i].

Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kevin Long | last post by:
Hi there. I have been using Excel in conjunction with Visual Basic for writing a fluid flow program. I have 3 drop down boxes on the the spreadsheet and each time I select an item from the drop...
5
by: Jim Bo | last post by:
Hi, I have a drop down menu that is being populated by a query to the access database ---- Code --- Skill needed <SELECT size="1" NAME="SkillType" VALUE="SkillType"> <OPTION>...
4
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by...
1
by: Dan | last post by:
This is one that has me stumped and I need an expert's input. Any ideas why the values from the second script-generated drop down list isn't recognized by the script to add time values to the...
3
by: Don Wash | last post by:
Hi There! I have a Server-side Drop-down box in ASP.NET (VB) page. What do I do to widen the Drop down box's Pull-Down list's width? I'm not talking about the Drop-down box's width but the box...
1
by: pmelanso | last post by:
Hello, I have a drop down list which is dynatically loaded from a database and I have a second drop down list that is also dynatically loaded depending on what is selected in the first drop down...
7
by: callawayglfr | last post by:
I am building a database in access where I have a drop down box that relates to a text box, that part I have working but when someone selects information from the first drop down I need it to limit...
1
by: sparksol | last post by:
I have a form with a drop down box. If you select an option in the drop down box (depending which option is selected) one or two textbox(es) and a submit button display. I would like to keep the...
3
by: amcoldspy | last post by:
Hi, am trying to create dynamic drop down boxes.. there are 3 drop down boxes. The second drop down box elements are to be update based on the selection made in the first drop down box...
4
by: bonneylake | last post by:
Hey Everyone, Well this is probably a pretty easy question, but for some reason i just can not figure it out. What i am trying to do is redisplay what was entered previously. I have figured...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.