Community Forums 

Main Content

Re:Expand drop down list to show all options

    Feb 13 2017 10:37:10

    #1

    Geoff

    Join date : 2008-09-18      Posts : 415

    To show all options in a dropdown use the size attribute. Javascript is used to display the selected option. Below is a simplified form to show how it would work.

    <form>

    <select size="3" onchange="document.getElementById('selection').innerHTML=this.options[this.selectedIndex].value">

    <option value="birth">birth</option>
    <option value="death">death</option>
    <option value="marriage">marriage</option>

    </select>

    <p><input type="text" value="">&nbsp;<span id="selection"></span></p>

    </form>