博客 (3)

form 提交 checkbox

<form method="get" asp-action="Index">
    <input type="checkbox" name="a" value="1" /> 一
    <input type="checkbox" name="a" value="2" /> 二
</form>

get 方式的 url 中会出现多个相同名称的参数

/abc?a=1&a=2

C# 使用数组类型接收参数

public IActionResult Index(string[] a)
{
}


xoyozo 4 年前
2,930
<input name="aaa" id="theinput" type="checkbox" />

// 选中它

$('input[name="aaa"]').prop("checked", true);

// 取消它

$('input[name="aaa"]').prop("checked", false);

// 顺便提一下将 select 选中首项

$("#ddl_types option:first").prop('selected', true);

// 获取选中的项

$('input[name="aaa"]:checked').each(function(){ });

// 获取项是否选中

$('#theinput').is(':checked')

$('#theinput').prop('checked')

theinput.checked

// 获取 radio 选中项的值

$('input[name="aaa"]:checked').val()
xoyozo 7 年前
3,890

下载最新的免费CodeHighlighter组件 http://www.CodeHighlighter.com

1。确保web.config中的languages节点的.xml文件路径正确。
2。可以在insertCode.aspx更改编辑的默认设置,如checkbox的check等。(或在项目中搜索相关代码)

 


 

 

 

DotNetTextBox 已集成CodeHighlighter,我的修改如下:

xoyozo 16 年前
4,674