나는 aspx 페이지가 있는데 여기에는 세 개의 플레이스 홀더가 있습니다. 이제 각 자리 표시 자 안에 체크 박스가 있습니다. clientside에서 체크 박스의 checked 속성을 검색하려면 어떻게해야합니까? 나는 다음 코드를 시도 ..하지만 작동하지 않습니다 ..Gridview에서 체크 박스의 체크 된 속성을 가져옵니다.
<asp:CheckBox ID="lblIsActive" runat="server" CssClass="s_label" />
function Mark_Confirm(elem)
{
//var chk=document.getElementById("<%=lblIsActive.ClientID%>");
var div = document.getElementById('<% = lblIsActive.ClientID %>');
var chk = div.getElementsByTagName('input');
var len = chk.length;
if (chk.type == 'checkbox')
chk.checked = elem.checked;
if(chk.checked==true)
{
if (confirm("Do you want to mark the device as lost?"))
{
var confirm_value1 = document.createElement("INPUT");
confirm_value1.type = "hidden";
confirm_value1.name = "confirm_value1";
confirm_value1.value = "Yes";
}
else
{
confirm_value1.value = "No";
}
}
if(chk.checked==false)
{
if (confirm("Do you want to mark the device as active?"))
{
var confirm_value2 = document.createElement("INPUT");
confirm_value2.type = "hidden";
confirm_value2.name = "confirm_value2";
confirm_value2.value = "Yes";
}
else
{
confirm_value2.value = "No";
}
}
document.forms[0].appendChild(confirm_value1);
document.forms[0].appendChild(confirm_value2);
}
**
그것은 긴급한 문제입니다. 어떤 도움을 주신다면
문제와 같은 특성 해결을 확인할 수있는 '
checked
'속성또는 jQuery를 사용하여 사용할 수 있습니까? – Talha
문제가 해결되면 plz에서 하나의 대답을 수락합니다 ... – Talha