在jquery中的dropdowncontrol change事件中未选中复选框 [英] Check box not checked inside dropdowncontrol change event in jquery

查看:124
本文介绍了在jquery中的dropdowncontrol change事件中未选中复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想查看下拉列表更改事件中的chxkbox



我的代码是如下所示



Hi,

I want to check a chxkbox inside dropdownlist change event

my code is like below

$('#ddlrole').change(funtion()
{
$('#namecheckbox').attr('checked','checked');
});







我的复选框和下拉列表如下所示






my checkbox and dropdownlist is like below

@Html.DropDownList("Roles", new SelectList((IEnumerable<EmployeeManagementSystem.DAO.RoleMaster>)ViewData["Roles"], "RoleId", "RoleName"), "Select Role", new { @id = "ddlrole", @class = "med m-wrap" })
                                       @Html.CheckBox("CheckBox", new { id = "namecheckbox"})





但它不起作用



任何人帮帮我





谢谢

kunjammu



but its not working

anybody help me


thanks
kunjammu

推荐答案

('#ddlrole')。change(funtion()
{
('#ddlrole').change(funtion() {


('#namecheckbox')。attr( '检查', '检查');
});
('#namecheckbox').attr('checked','checked'); });







我的复选框和下拉列表如下所示






my checkbox and dropdownlist is like below

@Html.DropDownList("Roles", new SelectList((IEnumerable<EmployeeManagementSystem.DAO.RoleMaster>)ViewData["Roles"], "RoleId", "RoleName"), "Select Role", new { @id = "ddlrole", @class = "med m-wrap" })
                                       @Html.CheckBox("CheckBox", new { id = "namecheckbox"})





但它无效< br $>


任何人帮帮我





谢谢

kunjammu



but its not working

anybody help me


thanks
kunjammu


在下面试试

try below


这篇关于在jquery中的dropdowncontrol change事件中未选中复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆