asp.net-mvc - Select2 搜索框值张贴在表单提交偶数不匹配
问题描述
问题:
在 select2 搜索框中搜索后按 enter 时,即使搜索值不匹配,文本框也会填充搜索值(并且在表单提交上发布相同)。
搜索期间:
回车后:
我正在使用带有剃刀视图的select2 ( select2.full.js
version )。Select2 4.0.6-rc.1
HTML:
@Html.DropDownListFor(m => m.PartModel.AccountId, Model.PartModel.AccountList, "-- Select --", new { @class = "form-control search select2picker" })
Javascript:
$(document).find('.select2picker').select2({
tags: true,
});
解决方案
推荐阅读
- html - Unable to access other service of docker-compose from HTML
- python - 使用地址在 python 进程之间共享 ctype 内存
- vuejs2 - 在不影响路由器的情况下分组页面 - Nuxt.js
- apache-spark - 加载 Spark Config 以测试 Spark 应用程序
- google-cloud-dataflow - Apache Beam 中全局窗口的基于时间的触发器
- json - 解析 JSON 时出现 IllegalStateException
- r - 如何使连续变量反应?
- java - 自动在 JIRA Adaptavist 工具中发布测试结果,来自 Eclipse 上运行的 rest api 测试用例
- android - Kotlin 编译器警告和应用程序无法执行
- php - error_get_last() 为空时怎么办?