我正在使用 ddslick 制作带有图标的下拉菜单,唯一的问题是当我发布表单时,所选选项的值始终为空,如果我关闭 ddslick,它就可以正常工作。
<script language="javascript" type="text/javascript">
$('.cflagdd').ddslick({
onSelected: function(selectedData){
//callback function: do something with selectedData;
// $('#editcflag').submit(); - this does not work, posts form on page load
}
});
</script>
<select class="cflagdd" name="cflag">
<option value="0" selected="selected">No action flag set</option>
<option value="1" data-imagesrc="'.base_url().'images/Actions-flag-green-icon.png">Resolved</option>
<option value="2" data-imagesrc="'.base_url().'images/Actions-flag-yellow-icon.png">Investigate</option>
<option value="3" data-imagesrc="'.base_url().'images/Actions-flag-red-icon.png">Urgent</option>
<option value="4" data-imagesrc="'.base_url().'images/Actions-flag-blue-icon.png">False positive</option>
</select>
版本:Jquery-1.7.2.js jQuery UI - v1.8.20
感谢您的帮助,非常感谢