You have a typo. Instead:
$('#myselect').append('<option val="'+newitemnum+'">'+newitemdesc+'</option>');
You need:
$('#myselect').append('<option value="'+newitemnum+'">'+newitemdesc+'</option>');
Here is the JSFiddle daemon: http://jsfiddle.net/xbr5agqt/
The Add button and select Soy Sauce will add the following:
$("#myselect").append('<option value="'+newitemnum+'">'+newitemdesc+'</option>'); $("#myselect").val(4); $("#myselect").selectpicker("refresh");
One slightly faster approach (used by the Add button and select Repeat) to add a new <option> element with the selected attribute already applied:
$("#myselect").append('<option value="'+newitemnum+'" selected="">'+newitemdesc+'</option>'); $("#myselect").selectpicker("refresh");
source share