I created this code:
$("input[name*='Gridview1$ctl02']").each(function () {
if(this.type == 'checkbox'){
if(this.checked == true){
alert("test")
}
else
{
alert("test2")
}
}
})
Its good when I write this $("input[name*='Gridview1$ctl02']") but I need array of ct101,ct102,ct103

I need Something like this:
$("input[name*='Gridview1']").find("ct").each ...
You can simple create a selector to match any element where their name starts with Gridview1:
$("input[name^='Gridview1']").each(function () {if(this.type == 'checkbox'){if(this.checked == true){alert("test")}else{alert("test2")}}})
Alternative if you want only text inputs:
$("input[name^='Gridview1'][type='text']").each(function () {if(this.type == 'checkbox'){if(this.checked == true){alert("test")}else{alert("test2")}}})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With