Reputation: 551
I everybody,
I've a multi-select like this:
<select multiple="multiple" id="lista">
<option value="a">Mario</option>
<option value="b">Maria</option>
<option value="c">Mark</option>
</select>
How can I prevent to select multiple option by a user? (shift+arrow up/down)
thanks in advance
ciao h.
Upvotes: 2
Views: 1814
Reputation: 15616
Although I'm not sure why you can't simply remove multiple="multiple"
in the HTML, here's how you would do it with jQuery:
// Wait until the DOM is loaded
$(function(){
$('#lista').removeAttr("multiple");
});
Upvotes: 2
Reputation: 546
You need to provide size attribute to it..
<select id="lista" size="3">
<option value="a">Mario</option>
<option value="b">Maria</option>
<option value="c">Mark</option>
</select>
Upvotes: 2