Monday, 24 August 2015

dropdown list height limit using javascript

<div class="form-group input-group">

   <span class="input-group-addon"  style="padding: 9px;"> Select a order no</span>
 <select name='order' class="form-control" onmousedown="if(this.options.length>5){this.size=4;}" onchange="this.size=0;" onblur="this.size=0;"
  style="padding: 3px;
    position: absolute;
    width: 160px;">
 <option value='1' >1</option>
<option value='2' >2</option>
<option value='3' >3</option>
<option value='4' >4</option>
<option value='5' >5</option>
<option value='6' >6</option>
<option value='7' >7</option>
<option value='8' >8</option>  </select>

demo:

Select a order no

No comments:

Post a Comment