javascript function to check value present in gridview or not
-
i am using js function to check gridview value existence it was working fine for single page it doesnt check the whole records it only checks those records which are on current page,
function checkval() { var txt=document.getElementById("<%= txt_category.ClientID %>").value; var theGridView = document.getElementById("<%= gv_faculty_category.ClientID %>"); if(theGridView!=null && txt!="") { for ( var rowCount = 1; rowCount < theGridView.rows.length; rowCount++ ) { alert(theGridView.rows.length); if ( theGridView.rows(rowCount).cells(0).children(0)!=null) { // Find Check Box control in gridview var theGridViewLable = theGridView.rows(rowCount).cells(1).children(0); if(theGridViewLable.innerHTML==txt) { document.getElementById("<%=lbl_proceed.ClientID %>").innerHTML="Category Exists"; document.getElementById("<%=hf.ClientID %>").setAttribute("value","no"); break; } else { document.getElementById("<%=lbl_proceed.ClientID %>").innerHTML="Proceed"; document.getElementById("<%=hf.ClientID %>").setAttribute("value", "Proceed"); } } } } else { document.getElementById("<%=lbl_proceed.ClientID %>").innerHTML=""; document.getElementById("<%=hf.ClientID %>").setAttribute("value", "Proceed"); } }
can u plz help me thanks in advancelearning developer