PDA

View Full Version : Horizontal scrollbars for a <select>



bhakti_thakkar
Aug 29th, 2007, 07:10 AM
Hi all,
I need to add a Horizontal Scrollbar for a List box in the PHP page which I have. I am using the <select> tag for creating a listbox. Could anyone of U please help me out in getting a horizontal scroll bar for this list box?

Thanks

rmedek
Aug 29th, 2007, 07:52 AM
"overflow: auto" in your CSS should do the trick…not sure what you're looking for, so if you need more help you should post some code or a link or a screenshot.

bhakti_thakkar
Aug 29th, 2007, 08:35 AM
hi,


"overflow: auto" in your CSS should do the trick…not sure what you're looking for, so if you need more help you should post some code or a link or a screenshot.


i am populating the data of the <select> from DB. but as there are few items which are really long. also i have restricted the width of the <select> due to page constraint and i want that the use should be able to read the full option... below is my code also i have added the overflow property but it isnt helping :confused:

<select name="RSStatement_ID" class="txtbox" style="width:380;overflow:auto">
<option value="">Select </option>

<?foreach($RSStatementArr as $rsarr) {?>
<option value="<?=$rsarr['pk']?>"><?=$rsarr['dispdata']?></option>
<? } ?> </select>

Thanks