【发布时间】:2016-12-05 09:12:30
【问题描述】:
我使用了一个带有搜索输入和“添加”按钮的自定义选择框。这个输入字段的作用类似于搜索和搜索下拉选项中的值。但是当值与值不匹配时,我需要单击该添加按钮时,该字段的值应添加到选项中,并充当下拉列表的选定值。请帮忙...
谢谢..
$(function() {
$(".standards").customselect();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src='http://classvita.com/admin/res/javascripts/jquery-customselect.js'></script>
<link href='http://classvita.com/admin/res/stylesheets/jquery-customselect.css' rel='stylesheet' />
<select name='standard' class='custom-select standards'>
<option value=''>Add Particular</option>
<option value='1'>abc</option>
<option value='2'>aabc</option>
<option value='3'>abbc</option>
</select>
【问题讨论】:
-
添加你的完整代码到现在。我们不知道您的添加按钮和其他详细信息是什么
-
只需点击添加特定,有一个下拉菜单,最后有一个添加按钮..它的代码在链接的js文件中
-
你能告诉我们添加新项目的代码是什么吗?是插件生成的吗?
标签: javascript jquery html