In my asp page, i have three text and 2 label box.On text box onblur event i called a javascript function by passing textbox clientid.But i cant get the textbox or label box value from the id i passed.
this is my code...
<script type="text/javascript">
function num_validate(cid,cid1) {
var patt = /^\d*(\.\d{1,2})?$/;
if (cid1 == "t1") {
var value=this.document.getElementById(cid).value; //failed
this.document.getElementById(cid).focus(); //failed
var ff = document.getElementById('<%= l1.ClientID %>').value);//failed
}
}
</script>
<asp:TextBox ID="t1" runat="server" onblur="javascript:num_validate(this,'t1')"> </asp:TextBox> <asp:Label ID="l1" runat="server" Text="3"></asp:Label>
<asp:TextBox ID="t2" runat="server" onblur="javascript:num_validate(this,'t2')"></asp:TextBox>
<asp:Label ID="l2" runat="server" Text="5"></asp:Label>
<asp:TextBox ID="t3" runat="server" onblur="javascript:num_validate(this,'t3')"></asp:TextBox>
I could not able the text box,label box value by using either cid,cid1...
Please guide me to get out of this issue?