Page 1 of 1
forms selct box
Posted: Fri Nov 30, 2007 9:57 pm
by FireElement
My google skills are getting worse I think?
Anyways I just wondered if there was away to change the length of a select box.
Say if I had 100 options how would i make only 10 show in the drop down box.
That way the select box would be more user friendly! Is it possible?
Posted: Fri Nov 30, 2007 10:25 pm
by FireElement
I dont mean size either!
I mean the actual bit that drops down!
Posted: Fri Nov 30, 2007 10:47 pm
by feyd
There is little actual control over that as it is drawn primarily by the host operating system with most browsers.
The only control we can (in some cases) exert over it is by setting the height value of the options, but be careful as the host system may not check those values and draw the box too large or off-screen.
This is a client-side question.
Posted: Fri Nov 30, 2007 10:57 pm
by FireElement
so basically not unless you use javescript? If its really complex then am not the bothered really just thought it was not listed because it was obvious.
Reminds me of the prime number formula.... there isnt one but you think there would be! i been close a few times but in the end the only patern I see is that all prime numbers after the first few of course all end in 1 3 7 or 9 also that any new prime numbers that accure knock out any what would seem like a prime number. Bascailly in other words you get 13 it will take out 39 it looks like prime but is not because 13 took it out. In other words prime numbers pattern is not possible because a previous prime number makes it random so you have to check every number that look like a prime with all prime numbers below half it self. eg all primes belwo 19.5 in 39 case to check its not a prime.
I dont really know why I said that guess I was just bored and decided I would have ago at breaking it again....
Anyways I may look in to javascript on it. To be honest I was not that fussed.
Posted: Tue Dec 04, 2007 4:11 am
by devendra-m
refer
http://www.hotandco.com/
select netherlands in the country field then you will get city field filled with cities. In that city field you can either type or select directly
Posted: Tue Dec 04, 2007 5:50 am
by CoderGoblin
Normally when I have a problem like this I start to look at
w3schools.com but it doesn't seem to be working today. Aside from core HTML which doesn't do what you want surely the answer lies in where you are getting the information from in the first place. If it is PHP it is easy enough to only show the first ten, to randomise it or rank it. This would be better than a pure javascript solution.
Posted: Tue Dec 04, 2007 3:16 pm
by RobertGonzalez
So you are looking for a select list that is long, or a select multiple list that only list the first 10 of the data set?
Posted: Wed Dec 05, 2007 10:42 am
by FireElement
I was looking to just make a the drop down part of a select box only display ten items and a scroll if more then ten was in.
Just so it was neater.
Posted: Wed Dec 05, 2007 11:01 am
by feyd
Do that in PHP.
Posted: Wed Dec 05, 2007 11:41 am
by RobertGonzalez
FireElement wrote:I was looking to just make a the drop down part of a select box only display ten items and a scroll if more then ten was in.
Just so it was neater.
Not sure if you can control the number of items shown in a select box before causing a scroll. I think this is controlled by the browser, which also controls whether the box opens up or down depending on placement in the viewport at the time the box is activated.