could anybody describe me how to find a control inside a ASP DetailsView using javascript? my requirement is to display a confirm box on a button's client click that checkbox is checked or not.
Here is the code working without DetailsView-
<script type="text/javascript" language="javascript">
function confirmation() {
var chkbx = document.getElementById("chkbox4PubnOrder");
if (chkbx.checked == false) {
var answer = confirm('Are you sure to add a feature which be published');
if (answer) {
return true;
}
else {
return false;
}
}
else {
return true;
}
}
</script>
where chkbox4PubnOrder is a asp checkbox. In case of details view, the above code is unable to find the checkbox
And I fire this onclientclick event of asp button-
OnClientClick="if(!confirmation()) return false;"
Please help...