<script type="text/javascript" language="javascript"> function check() { var valid = false; var gv = document.getElementById("MainContent_abc"); for (var i = 0; i < gv.all.length; i++) { var node = gv.all[i]; if (node != null && node.type == "checkbox" && node.checked) { valid = true; break; } } if (!valid) { alert("Select atleast one item to delete"); return false; } else { return confirm("Are you sure you want to delete?"); } } </script>
Try this
<script type="text/javascript" language="javascript"> function check() { var valid = false; var gv = document.getElementById("MainContent_abc"); var chks = gv.getElementByTagName("input"); for (var i = 0; i < chks.length; i++) { var node = chks[i]; if (node != null && node.type == "checkbox" && node.checked) { valid = true; break; } } if (!valid) { alert("Select atleast one item to delete"); return false; } else { return confirm("Are you sure you want to delete?"); } } </script>
Not working even in IE it displays
Microsoft JScript runtime error: Object doesn't support this property or method
<script type="text/javascript" language="javascript"> function check() { var valid = false; var gv = document.getElementById("MainContent_abc"); var chks = gv.getElementsByTagName("input"); for (var i = 0; i < chks.length; i++) { var node = chks[i]; if (node != null && node.type == "checkbox" && node.checked) { valid = true; break; } } if (!valid) { alert("Select atleast one item to delete"); return false; } else { return confirm("Are you sure you want to delete?"); } } </script>
It gives message in google chrome as: Resource interpreted as Script but transferred with MIME type application/x-js
Is it working else where?
© COPYRIGHT 2024 ASPSnippets.com ALL RIGHTS RESERVED.