473,574 Members | 2,545 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems and questions regarding HTML form SELECT elements

Hi,

I've been searching the net all day today trying to figure out how one
would accomplish what I originally thought would be a fairly straight
forward and simple thing. The problem I'm trying to solve is that the
designer would like to limit the total number of entires shown when
you click on the drop-down arrow of a select box. I'm starting to
think that this isn't possible.

I've tried the following with no luck:

- Setting the height attribute on the select element
- Setting a style height for the select attribute
- Modifying the same through Javascript
- Setting the style overflow-y to scroll
- Setting the size of the select element

At some point in my browsing someone claimed that the vertical scroll
bars are controlled by the OS/Browser and there are no ways to change
this using JS or CSS. That the magic number of IE is 30 entries before
the vertical scroll bar shows up.

That's where I'm at right now. Can anyone help shed some light on this?

Sep 18 '07 #1
3 4231
Gazing into my crystal ball I observed Matthew Cox
<Ma***********@ gmail.comwritin g in news:1190155091 .240101.234260
@k79g2000hse.go oglegroups.com:
Hi,

I've been searching the net all day today trying to figure out how one
would accomplish what I originally thought would be a fairly straight
forward and simple thing. The problem I'm trying to solve is that the
designer would like to limit the total number of entires shown when
you click on the drop-down arrow of a select box. I'm starting to
think that this isn't possible.

I've tried the following with no luck:

- Setting the height attribute on the select element
- Setting a style height for the select attribute
- Modifying the same through Javascript
- Setting the style overflow-y to scroll
- Setting the size of the select element

At some point in my browsing someone claimed that the vertical scroll
bars are controlled by the OS/Browser and there are no ways to change
this using JS or CSS. That the magic number of IE is 30 entries before
the vertical scroll bar shows up.

That's where I'm at right now. Can anyone help shed some light on
this?
>
I know you can do the checking server side, eg. (asp)
if ubound(split(se lectbox,", ")) number then
'too much
elseif selectbox = "" then
'nothing at all
else
'just right
end if

I would image there might be a way to do that client side, but I'm not a
javascript person. Maybe post to comp.lang.javas cript for a better
answer.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Sep 19 '07 #2
Scripsit Matthew Cox:
I've been searching the net all day today trying to figure out how one
would accomplish what I originally thought would be a fairly straight
forward and simple thing.
Since it appears to be something presentational, it would have been natural
to start from CSS, not HTML.
The problem I'm trying to solve is that the
designer would like to limit the total number of entires shown when
you click on the drop-down arrow of a select box. I'm starting to
think that this isn't possible.
Just tell the dee-ziner that it isn't possible. If it isn't strictly true,
it's just a white lie. It's certainly not possible in HTML, and it wouldn't
be useful anyway. The real problem is in the dee-ziner's mind: (s)he wants
controls to look cool, instead of being useable. That's a particularly bad
way of being control freak.

Drop-down controls created using select boxes are relatively rarely the best
way to deal with a one-out-of-many choice, and a manifestly poor approach to
many-out-of-many choices. For a general discussion, see
http://www.cs.tut.fi/~jkorpela/forms/choices.html

If the default behavior for the drop-down is not suitable, the odds are that
you are way beyond the scope of applicability of <select>. If you want fewer
options to pop up, then you are just a control freak, or a slave of a
control freak. (I'm trying hard to express this stronger, but I'm so poor in
such things.)
At some point in my browsing someone claimed that the vertical scroll
bars are controlled by the OS/Browser and there are no ways to change
this using JS or CSS.
Could be. In any case, it would be browser dependent and would depend on
non-HTML technologies that might be switched off for various reasons.
That the magic number of IE is 30 entries before
the vertical scroll bar shows up.
Could be. It was when I just tested it: with 30, no scroll bar, with 31,
scroll bar. This might sound nasty if you planned to use <selectfor
selecting day of month, but who on &Planet; would dream of doing so? :-)
Typing in one or two digits is surely easier than picking up a number from a
list of 31 numbers.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Sep 19 '07 #3
Matthew Cox wrote:
Hi,

I've been searching the net all day today trying to figure out how one
would accomplish what I originally thought would be a fairly straight
forward and simple thing. The problem I'm trying to solve is that the
designer would like to limit the total number of entires shown when
you click on the drop-down arrow of a select box.
Even though that could only make sense in a very narrow set of
presentation layouts, strangely, there's a standard way to give a size
information (just a guideline) in HTML:
http://www.w3.org/TR/html4/interact/forms.html#h-17.6

This applies to list box representations , not to "drop-down boxes", but
user agents are free to interpret them as they wish.
Actually, IE6 behavior is to use a list box with N rows whenever SIZE=N is
specified, otherwise, a combo box is used, even when there's only one or
two options!

Opera 8.54, Mozilla 1.7, Netscape 1.22 & higher and 1X 1.0 share the same
behavior on Win32 as well as Opera and Dillo on GNU/Linux, but other
behaviors, such as the one of Elinks, are perfectly sane.

I'm starting to
think that this isn't possible.
It isn't. The designer cannot *limit* the total number of entries "viewed"
at once for any sense of the word "viewed". HTML isn't an imperative
language, it is a declarative language.
You can just give a guideline, interpreted or not, depending on whether it
makes sense to the user agent and whether the user agent or the user
wishes to accept this imposed value.
At some point in my browsing someone claimed that the vertical scroll
bars are controlled by the OS/Browser and there are no ways to change
this using JS or CSS.
With ActiveX, you can. But ActiveX is a quite offensive technology:
Executing arbitrary binary code on the client machine.
That the magic number of IE is 30 entries before
the vertical scroll bar shows up.
This probably depends on the OS and version of IE and maybe user settings,
screen resolution and font sizes.
With Windows 98 SE and IE6, for 12 or more entries, there's a scroll bar.

--
You can contact me at <ta************ *****@yahoDELET ETHATo.fr>
Sep 22 '07 #4

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

Similar topics

0
3474
by: Michael Fork | last post by:
Note: I pasted the code the attachments as plain text after the message (I wasn't able to post it with an attachment...) Attached are the XSL and XML files that I am having problems with. I am trying to extract the stock information after having downloaded the HTML and converted to XML (well-formed HTML) using XSL and XPATH and am unable. ...
3
2006
by: Ondernemer | last post by:
Hi guys, On my page I dynamically create different checkboxes. <input type="checkbox" name="ch1" value="some value"> option 1 <input type="checkbox" name="ch2" value="some value"> option 2 <input type="checkbox" name="ch3" value="some value"> option 3 <input type="checkbox" name="ch4" value="some value"> option 4 The reason they have...
5
1748
by: doc | last post by:
Hi, <SCRIPT LANGUAGE="JavaScript"> function check_selection(selection){ document.pr.n_o.checked=true; } </SCRIPT> <form name=pr action=test.php method=post>
9
1394
by: please-answer-here | last post by:
What is wrong with this code? when i place "return false" before the xfab assignment the form as intended doesn't submit. But when placed as here or in the last if/else construct the page gets submitted regardless of any errors response.write("<form method=""POST"" action=""scandia.asp"" onSubmit=""return pre_submit_gem()""...
22
3311
by: Luke | last post by:
Elements with name attribute: form, input, textarea, a, frame, iframe, button, select, map, meta, applet, object, param, img (if you know more reply...) Methods of addresing html elements: <form name="myform"> <input name="myinput" /> </form> 1. var input = document.forms.myform.myinput;//from nn3+ 2. var input =...
17
2466
by: Lloyd Sheen | last post by:
This IDE is driving me nuts. I needed another button so I copied an existing one, changed the Text and the id and position by drag and drop. Well then I run and get the following: Control 'Button19' of type 'Button' must be placed inside a form tag with runat=server Can the IDE not do what it is supposed to do. It seems that it is a...
38
3461
by: Luke Matuszewski | last post by:
Welcome I have read the in the faq from jibbering about the generic DynWrite, but i also realized that is uses only innerHTML feature of HTML objects. (1) Is there a DOM function which is very similar to innerHTML property eg. (my guess) setInnerNodeAsText or sth... ? I want to write function which will be dynamically updateing some of my...
2
3104
by: rehevkor5 | last post by:
I have written Javascript which populates a form with <select> elements dynamically based on some other stuff going on in the page. The problem is that I can't get it to work properly in IE, and the closest I can get to it working doesn't work in FireFox. The first thing IE does wrong is that it only selects the last <option> even though...
2
2105
by: justplain.kzn | last post by:
Hi, I have a table with dynamic html that contains drop down select lists and readonly text boxes. Dynamic calculations are done on change of a value in one of the drop down select lists. Using Safari,my first iteration the script works fine ( indicating that there are 33 form variables ). When trying another dropdown select value, the
0
7815
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8077
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6476
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5316
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3755
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1076
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.