c# - 如何使用文本框创建多选下拉列表
问题描述
我需要使用文本框创建多选下拉列表。在我的下拉列表中,当我单击“其他”选项时,我有“其他”选项,然后我必须在下拉列表中显示文本框以输入自定义值。而且我在第二次点击我的下拉列表时遇到了这个问题。
这是我的 CSHTML 代码:
@Html.DropDownListFor(m => m.TrainingToolValue, new MultiSelectList(Model.TrainingTool, "TrainingToolID", "ToolName"), new { @id = "TrainingToolId", @class = "form-control", multiple = "multiple" })
这是我的脚本代码
<script type="text/javascript">
$(document).ready(function () {
$("#TrainingToolId").multiselect({
includeSelectAllOption: true,
});
}); </script>
是否有可能在下拉列表中添加文本框
解决方案
推荐阅读
- python - 轴承计算方法的区别
- android - 在后台更新位置?
- javascript - 控制器 Express 中未定义的请求正文
- python - 希望不和谐机器人用户能够指定特定的默认参数
- python - Elastic Beanstalk 和 Django 上的 TensorFlow
- reactjs - 如何使用 React 在 Jspdf 中添加自定义字体?
- python - 图像 PyQt 的坐标
- vuejs2 - 我该如何解决这个与 vue 相关的问题
- node.js - 猫鼬查询按特定字段对主文档和子文档进行排序
- mongoose - Mongoose:查询“值”或 /value/i 之间的区别