Trying to find a way to allow a <select> element to have <option> items span multiple lines.
Found this & it looks great:
http://jsfiddle.net/ZTs42/2/
Can't get it to work on my situation.
In head section, I have these:
<link rel="stylesheet" href="
https://cdnjs.cloudflare.com/ajax/libs/jquery.selectboxit/3.3.0/jquery.selectBoxIt.css">
<script src="
https://cdnjs.cloudflare.com/ajax/libs/jquery.selectboxit/3.3.0/jquery.selectBoxIt.min.js"></script>
and this css:
.selectboxit-container .selectboxit, .selectboxit-container .selectboxit-options {
width: 400px; /* Width of the dropdown button */
border-radius:0;
max-height:100px;
}
.selectboxit-options .selectboxit-option .selectboxit-option-anchor
{
white-space: normal;
min-height: 30px;
height: auto;
}
This in HTML: (first few options only shown)
<select name="sprop">
<option value="">--- Select a Property ---</option>
<option value="10644" >2300 East Valley Parkway, Space 152, Escondido, 92027-SN: 76018345, test date 02/22/2020</option>
<option value="10645" >2300 East Valley Parkway, Space 152, Escondido, 92027-SN: AB7593, test date 02/22/2020</option>
<option value="10647" >2300 East Valley Parkway, Space 152, Escondido, 92027-SN: 98765432, test date 02/22/2020</option>
<option value="10648" >2300 East Valley Parkway, Space 152, Escondido, 92027-SN: 123ABC465, test date 02/22/2020</option>
<option value="10646" >2300 East Valley Parkway, Houston, 92027-SN: 98765432, test date 02/22/2020</option>
<option value="10620" >2300 East Valley Parkway, Space 152, Escondido, 92027-SN: 76018345, test date 02/21/2020</option>
I am almost certain I have to attach a class to the select element but the I don't see it in the jsfiddle.
I did NOT include the jQuery because I don't need the alert.
What's wrong?
Open in new window