I've这些剑道单选按钮,它们只选择第一个单选按钮值
I've these Kendo radio buttons and they select just the first radio button value
我有这些Kendo单选按钮,它们只选择第一个单选按钮值这是快照请检查此图片它总是得到第一个要保存的值,而不是其他值,即使它们被选中,我也尝试过使一个值为真,然后它只发送永久为真的值,即使我更改了它也不会起作用。
这是无线电按钮代码
<td class="span2">
@Html.Label("lblType","Select Document Type")
</td>
<td>
@Html.RadioButton("docType", "SA")Service Agreement
<br />
@Html.RadioButton("docType", "W9")W9
<br />
@Html.RadioButton("docType", "COI")Certificate of Insurance
<br />
@Html.RadioButton("docType", "WC")Workers Comp
<br />
@Html.RadioButton("docType", "Other")Other
</td>
这是java脚本。UrlDrop是一个有url的函数,我在函数外使用了它,但也不起作用。
function UrlDrop() {
return '@Url.Action("UploadFiles", "Vendor")?id=' + id + "&documentType=" + $("#docType").val(); //is(":checked"); //val();
}
//alert($("#docType").val());
$(function () {
$('#dropZone').filedrop({
url:UrlDrop ,//'@*@Url.Action("UploadFiles", "Vendor", new { id = TempData["VendorId"], docTypes= (("docType:checked"))})*@',
paramname: 'files',
maxFiles: 10,
dragOver: function () {
$('#dropZone').css('background', '#71b43b');
},
dragLeave: function () {
$('#dropZone').css('background', '#dbf0cb');
},
drop: function () {
$('#dropZone').css('background', '#dbf0cb');
},
afterAll: function () {
$('#dropZone').html('The file(s) have been uploaded successfully!');
var grid = $("#VendorAttachmentGrid").data("kendoGrid");
grid.dataSource.page(1);
grid.dataSource.read();
},
uploadFinished: function (i, file, response, time) {
$('#uploadResult').append('<li>' + file.name + '</li>');
}
});
这是控制器。它总是获取要保存的第一个值,而不是其他值,即使它们已被选中。
public ActionResult UploadFiles(IEnumerable files, long id, string documentType="")
@Html.RadioButton
生成一个单选按钮组,可由其name
(而非id
)访问。
所以你必须得到这样的值:
function UrlDrop() {
var docType = $("input[name='docType']:checked").val();
return '@Url.Action("UploadFiles", "Vendor")?id=' + id + "&documentType=" + docType;
}
@(Html.Kendo().RadioButton().Name("radiobutton_legal").Checked(true).HtmlAttributes(new { @name = "search_type" }).Label("Физлицо"))
@(Html.Kendo().RadioButton().Name("radiobutton_entity").Checked(false).HtmlAttributes(new { @name = "search_type" }).Label("Юрлицо"))
@(Html.Kendo().RadioButton().Name("radiobutton_cooperative").Checked(false).HtmlAttributes(new { @name = "search_type" }).Label("ЖСК"))
-----
function addAddressData() {
var search_type = 0;
if ($("#radiobutton_legal").prop('checked')) {
search_type = 1
} else if ($("#radiobutton_entity").prop('checked')) {
search_type = 2
}
else if ($("#radiobutton_cooperative").prop('checked')) {
search_type = 3
}
return {
keyword: $("#autocomplete_address").val(),
search_type: search_type
}
}
相关文章:
- 根据页面加载时的单选按钮选择显示某些字段
- Ng点击记住单选按钮选择
- Angular未更新单选按钮选择
- 阅读JS中的单选按钮选择
- JQuery IE11 单选按钮选择器
- 确认单选按钮选择
- 贝宝表单问题的单选按钮选择
- 使用javascript在单选按钮选择上加载URL
- 显示基于多个单选按钮选择的图像
- 基于输入值的单选按钮选择
- 将域类id返回到由单选按钮选择的控制器
- 无法更改单选按钮选择 - KnockoutJS
- 单选按钮选择列表框更改并将 NULL 值传递给每个列表框
- 用户在Javascript的帮助下,仅通过单选按钮选择一个付款方式(信用卡)
- 基于多个单选按钮选择显示或隐藏元素
- 如何根据单选按钮选择在表中切换多个输入
- 无法更改单选按钮选择
- 提交页面而不为所需单选按钮选择值
- 使用基于单选按钮选择的 jquery 将表格单元格添加到行尾
- j查询动态验证单选按钮选择