Hii Experts,
im facing a problem with the javascript validation.i've a gridview in my web form and added a footer tempalte and placed textboxes in tht tempalte ,just to add a new row to the gridview and i wanna to validate the emalid entered in the footertextbox of the gridview. so i added a javasript function :
and i linked this function to the change event of my text box in the source code like this:
But unfortunately this is not working ...but for testing purpose i placed one textbox outside the gridview and i linked the javascript function to the textchange event in the same ..thn its working fine...
so the function is getting called for the textboxes outside the gridview..but not for the textboxes in the footer template of the gridview.
can anybody tell me what im missing ..
Thanks in Advance..
Rgds,
BTR.
im facing a problem with the javascript validation.i've a gridview in my web form and added a footer tempalte and placed textboxes in tht tempalte ,just to add a new row to the gridview and i wanna to validate the emalid entered in the footertextbox of the gridview. so i added a javasript function :
Code:
function OnCheckEmailID(srcID) { var email=document.getElementById(srcID); var filter =/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; if (!filter.test(email.value)&& !email.value=="") { alert('Please provide a valid email address'); email.value=""; email.focus(); return false; } else return true; }
Code:
<asp:TextBox ID="txtdummy" runat="server" Width="150px" OnChange="OnCheckEmailID('ctl00_BodyContent_txtdummy')" ></asp:TextBox>
so the function is getting called for the textboxes outside the gridview..but not for the textboxes in the footer template of the gridview.
can anybody tell me what im missing ..
Thanks in Advance..
Rgds,
BTR.
Comment