View Single Post
Old 10-03-2012, 09:30 AM   PM User | #6
shyagrawal
New Coder

 
Join Date: Sep 2012
Posts: 22
Thanks: 0
Thanked 6 Times in 6 Posts
shyagrawal is an unknown quantity at this point
you have to add "multiple" in the select tag to select multiple value. As I have added below:
<select multiple name="sel_list" id="sel_list" size="2" onchange="adOption.selOpt(this.value, 'optval')"></select><br/><br/>

Also, you have to update your delete function. Please see below:
adOption.delOption = function(list, optval) {
var opts = document.getElementById(list).getElementsByTagName('option');;
for(var i=opts.length -1; i >= 0 ; i--) {
if(opts[i].selected == true) {
document.getElementById(list).removeChild(opts[i]);
}
}
}

Let me know is this you want?
shyagrawal is offline   Reply With Quote