How can i check textbox null in grid view using javascript
-
I am using ajax script manager and update panel in my form .In that i placed a gridview .Grid view values are filled from database .And i add two button in that grid view to enter quantity and rate.I want to chect that text boxes null when i submit that form to database.How can i do that.If any one understand my problem pls give code. i used the following code to check textbox null or not but it display javascript error. function valform() { var theGridView = document.getElementById('<%=grdProdReqDetails %>'); for ( var rowCount = 1; rowCount < theGridView.rows.length; rowCount++ ) { var theGridViewRemarks = theGridView.rows(rowCount).cells(4).children(0); if ( theGridViewRemarks.value.replace(/\s/g,"")== "") { alert("Please enter Current Requirement"); theGridViewRemarks.value =""; theGridViewRemarks.focus(); event.returnValue = false; return; } }
-
I am using ajax script manager and update panel in my form .In that i placed a gridview .Grid view values are filled from database .And i add two button in that grid view to enter quantity and rate.I want to chect that text boxes null when i submit that form to database.How can i do that.If any one understand my problem pls give code. i used the following code to check textbox null or not but it display javascript error. function valform() { var theGridView = document.getElementById('<%=grdProdReqDetails %>'); for ( var rowCount = 1; rowCount < theGridView.rows.length; rowCount++ ) { var theGridViewRemarks = theGridView.rows(rowCount).cells(4).children(0); if ( theGridViewRemarks.value.replace(/\s/g,"")== "") { alert("Please enter Current Requirement"); theGridViewRemarks.value =""; theGridViewRemarks.focus(); event.returnValue = false; return; } }
May be this can help u... function CHKSelectAtleastOne(gridName) { var pointer=0; all=document.getElementsByTagName("input"); for(i=0;i<all.length;i++)> { if(all[i].type=="text")/*Checking if it is a textbox */ { if(all[i].value!="") pointer=1; } } if(pointer==0) { alert("Please select atleast one item"); return false; } else return true } and call this script on ur button click event Hope it helps...
When you fail to plan, you are planning to fail.
-
May be this can help u... function CHKSelectAtleastOne(gridName) { var pointer=0; all=document.getElementsByTagName("input"); for(i=0;i<all.length;i++)> { if(all[i].type=="text")/*Checking if it is a textbox */ { if(all[i].value!="") pointer=1; } } if(pointer==0) { alert("Please select atleast one item"); return false; } else return true } and call this script on ur button click event Hope it helps...
When you fail to plan, you are planning to fail.
I think u cant understand my problem.
-
I think u cant understand my problem.
deepthy.p.m wrote:
I think u cant understand my problem.
well i managed to extract what i understood. Please be clear. What do u want???
When you fail to plan, you are planning to fail.
-
deepthy.p.m wrote:
I think u cant understand my problem.
well i managed to extract what i understood. Please be clear. What do u want???
When you fail to plan, you are planning to fail.
Hi Do u have any java script wich converts English to French Thanks Siva
-
Hi Do u have any java script wich converts English to French Thanks Siva
ROTFL I cannot stop it...