checkbox validation in side datalist
how to validation checkbox in side datalist
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
ali tuncerPosted Feb 17, 2016, 9:16 PM
create a bool variable(isCheckBoxSelected) and set it to False before foreach..
Devendra KumarPosted Feb 15, 2016, 3:22 AM
Devendra KumarPosted Feb 15, 2016, 3:16 AM
Chandu KumawatPosted Feb 15, 2016, 1:49 AM
Amit Kumar SinghPosted Feb 15, 2016, 1:35 AM
use this javascript
function CheckBoxClicked(chk){
var dl = document.getElementById ("<%=DataList1.ClientID%>"); //Replace DatList1 with your DataList IDvar inputs = dl.getElementsByTagName("input") ;
for(var i=0;i{
if(inputs[i].id == chk.id)inputs[i].checked = true;
else
inputs[i].checked = false;}
}
}
And to your checkbox in datalist add this