<script type="text/javascript"> function trim(str) { return str.replace(/^\s*/g, '').replace(/\s*$/g, ''); } function bvalidate(event) { debugger; var txt1 = document.getElementById("txt1").value; var grid = document.getElementById("GridView1"); // var cell; if (txt1 == null || txt1 == "") { alert("country cannot be empty ") return false; } if (grid != null) { for (var i = 1; i <= grid.rows.length - 1; i++) { // cell = grid.rows[i].cells[1].innerText; if (trim(grid.rows[i].cells[1].innerText) == trim(txt1)) { alert("Item Already Exits") return false; } } return false; } } </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)