how to have scroll bar inside a list box?

admin

Administrator
Staff member
emm my listbox has more than 10 values ... how can i set the height for a listbox so that when more than 5 values, there will be a scroll bar in listbox?<!--content-->Er- I don't understand your terminology. What is a listbox?<!--content-->Use the size attribute of the <select> tag. If you wanted five items to show, use <select size="5"> . By the way, were you using a dropdown menu or a listbox? They are the same except that the listbox specifies how many items can be shown at once. The dropdown menu only displays one item until you press the arrow.<br />
<br />
And to omega: the 'listbox' he is referring to is a box with items being displayed at once like a dropdown menu but with or without a scrollbar. It's like this one:<br />
<br />
<!-- HTML 4.01 Strict Compliant --><br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><br />
<html><br />
<head><br />
<title>Listbox Example Just For omega</title><br />
<meta http-equiv="content-type" content="text/html; charset=utf-8"><br />
</head><br />
<body><br />
<p><br />
<select size="4"><br />
<option>Hello<br />
<option>Konnichiwa<br />
<option>Bonjour<br />
<option>Hola<br />
<option>Good Morning<br />
<option>Ohayou gozaimasu<br />
<option>Bonjour<br />
<option>Buenos Dias<br />
<option>Goodbye<br />
<option>Sayonara<br />
<option>Au revoir<br />
<option>Adios<br />
</select><br />
</p><br />
</body><br />
</html><br />
<br />
<br />
<!-- XHTML 1.1 Compliant --><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><br />
<head><br />
<title>Listbox Example Just For omega</title><br />
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /><br />
</head><br />
<body><br />
<p><br />
<select size="4"><br />
<option>Hello</option><br />
<option>Konnichiwa</option><br />
<option>Bonjour</option><br />
<option>Hola</option><br />
<option>Good Morning</option><br />
<option>Ohayou gozaimasu</option><br />
<option>Bonjour</option><br />
<option>Buenos Dias</option><br />
<option>Goodbye</option><br />
<option>Sayonara</option><br />
<option>Au revoir</option><br />
<option>Adios</option><br />
</select><br />
</p><br />
</body><br />
</html><!--content-->sorry sorry ...<br />
<br />
i want a dropdown menu ... :) poor english<!--content-->Dropdown:<br />
<br />
<select><br />
<option>kjaf;dsj<br />
....<br />
</select><br />
....<br />
<br />
<br />
Listbox:<br />
<select size="..."><br />
<option>kjaf;dsj<br />
....<br />
</select><br />
....<!--content-->
 
Back
Top