I have created a drop down box, which works fine, i want to increase the number of rows it shows without having to scroll, how do i do this though?
[PHP]
<td><select name="itjobtypeid" style="font: 10pt Tahoma" >
<option value=0 >Select IT Requests Type</option>
<?php
do {
?>
<option value="<?php echo $rowitjobtype['itjobtypeid']?>"><?php echo $rowitjobtype['jobtype']?></option>
<?php
} while ($rowitjobtype = mysql_fetch_assoc($resultitjobtype));
$totalRowsitjobtype = mysql_num_rows($resultitjobtype);
if($totalRowsitjobtype > 0) {
mysql_data_seek($resultitjobtype, 0);
$rowitjobtype = mysql_fetch_assoc($resultitjobtype);
}
?>
</select></td>
[/PHP]
8 3890 Atli 5,058
Expert 4TB
Hi Jason.
I've moved this question over to the HTML/CSS forums, where you are more likely to get an answer.
I've also changed the thread title to better describe it's contents.
Please try giving your threads descriptive titles. This helps the experts find threads they can help with and increases your chances of getting an answer.
Check out the Posting Guidelines for tips on how to create good thread titles. Moderator Atli 5,058
Expert 4TB
This cannot be done.
This is what I suspected.
The only thing I know that comes close is the 'size' property of the <select> tag, which will change it into a list-box, rather than a drop-down box.
@drhowarddrfine
Variations of these work for me depending on the specifics that you want:
onclick="size='45';" onmouseover="" onkeydown="size='60';" onfocus="" onmousedown="size='26';" onmouseout="size='1';" onmouseup="size='1';" onkeyup="size='1';" onchange="size='1';" onblur="size='1';"
Let us know what you run with.
hi try this code , -
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
<head>
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
<title>Untitled Document</title>
-
<style type="text/css">
-
.my.options{
-
overflow:auto;
-
height:auto;
-
background:#000;
-
}
-
</style>
-
<script type="text/javascript">
-
function height($){
-
$.size=$.options.length;
-
}
-
function closed($){
-
$.size=1;
-
}
-
function switcher($){
-
if($.size>1){
-
$.size='0';
-
document.body.focus();
-
}else{
-
height($);
-
}
-
}
-
</script>
-
</head>
-
-
<body>
-
<table>
-
<tr>
-
<td>
-
<select name="itjobtypeid" class="my" onfocus="height(this);" onchange="switcher(this);">
-
<option value=0 >Select IT Requests Type</option>
-
<option value="1">1</option>
-
<option value="2">2</option>
-
<option value="2">3</option>
-
<option value="2">4</option>
-
<option value="2">5</option>
-
<option value="2">6</option>
-
<option value="2">7</option>
-
<option value="1">1</option>
-
<option value="2">2</option>
-
<option value="2">3</option>
-
<option value="2">4</option>
-
<option value="2">5</option>
-
<option value="2">6</option>
-
<option value="2">7</option>
-
<option value="1">1</option>
-
<option value="2">2</option>
-
<option value="2">3</option>
-
<option value="2">4</option>
-
<option value="2">5</option>
-
<option value="2">6</option>
-
<option value="2">7</option>
-
<option value="1">1</option>
-
<option value="2">2</option>
-
<option value="2">3</option>
-
<option value="2">4</option>
-
<option value="2">5</option>
-
<option value="2">6</option>
-
<option value="2">7</option>
-
<option value="1">1</option>
-
<option value="2">2</option>
-
<option value="2">3</option>
-
<option value="2">4</option>
-
<option value="2">5</option>
-
<option value="2">6</option>
-
<option value="2">7</option>
-
</select></td>
-
</tr>
-
</table>
-
</body>
-
</html>
-
-
-
That's really cool, however it only works once, then goes back to the default dropdown. Its not obvious to me what needs tickling up to make it get the proper height again.
no its because you are just watching it in a blank page without any other field in side the form and the if you notice that the function height() is called onfocus and the focus is not lost until you click any other element or anywher inside the page , if you do it will work back to back and when you are inside a form with multiple inputs it wont happen there , but anyhow we can still improve it
regards,
Omer Aslam
I want to thank you for your effort here Omer, I think this is a key usability requirement that is seldom considered. In the moment that one is searching for something generally the only need at that time is to see the data prospects (an exception is where one needs to visually copy the text that cannot be readily clipboarded, e.g. from an image). The eye and brain scans what can be seen quicker than any scrolling can ever achieve. Typically there is circa one or two million pixels in front of the person at the moment of that search, yet designers everywhere unwittingly say I am going to torture you with a little glimpse of what I have here for you - and I am going to make you work your fingers to get what you want. This is probably more important for NLP types who are visually dominant. Any interface not implementing this principle is not optimally usable. One of my pet farthings worth. Thank you for your contribution here.
I'll do some more testing, an obvious test is what happens when the number of rows exceeds the control / screen height?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mad Scientist Jr |
last post by:
I'm trying to get javascipt select all items in a HTML form <SELECT>
control and submit the form to an asp.net page. For some reason when
the link is clicked, you can see the items all get...
|
by: Darren |
last post by:
Please Help Me!!
I've created a typical <form> and a <select> element. The options are
created dynamically from my access database (using asp).
There are about 70 options, and when you click...
|
by: Joachim Bauer |
last post by:
I'm using the code below to display a menu that opens when the mouse
goes over the main menu item (try it in your browser to understand the
behaviour).
It uses "position:absolute" and a switch...
|
by: rayone |
last post by:
Hi folks.
I need advice.
2 options, which do you think is the better option to
display/retrieve/report on the data.
Keep in mind reporting (Crystal), SQL Performance, VB Code, usability,...
|
by: joseph.lindley |
last post by:
Forgive me for I am a bit of a web-dev novice - but I'm not doing too
bad.
I'm currently working with a bit of javascript to dynamically add
<option>s into a select box. My code currently works...
|
by: frey |
last post by:
i tried to create a dropdown menu and use the option as a control to
change content inside another text area
the code is like this:
<select name="xxxx"><option onclick="changeunitprice(29.87)"...
|
by: i_dvlp |
last post by:
I'm trying to replicate a fancy drop-down control (MS-egads!) with
form <select><option>
It doesn't look like you can specity width as an attribute or define
width with CSS.
It looks like my...
|
by: Isha |
last post by:
Hi all,
I wanted to change the background color for only the first option in a
select box, but following changed the background color for the whole
dropdown box.
<select name="alltags"...
|
by: ismailc |
last post by:
Good day,
I know it is not possible to change the border of a dropdown (select tag) in IE7 browser.
I managed to change the height by increasing the font of the dropdown.
I don't realy...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |