Hi,
I am trying to validate textbox inside gridview footer template as the following:
<script language="javascript" type="text/javascript">
function validate(obj)
{
if (document.getElementById(obj).value=="")
{
alert("no data entered");
document.getElementById(obj).focus();
return false;
}
return true;
}
</script>
In the code behind, I added the following:
Dim InsertN As TextBox = TryCast(GridView1.FooterRow.FindControl("InsertN"), TextBox)
Dim Insert As LinkButton = TryCast(GridView1.FooterRow.FindControl("Insert"), LinkButton)
Insert.Attributes.Add("onclick", "return validate('" + InsertN.ClientID + "');")
Now, the problem is that I have more than one textbox control to validate.
Any idea what needs to be done in order to validate all textbox controls one by one?
Thanks.