<script type="text/javascript" language="javascript"> function ctrl(ctrlname) //now you have the control name in the ctrlname. by refering this you can know which control is in focus { if (ctrlname==document.getElementById('<%= TextBox1.ClientID %>')) { alert('textbox1 is focus'); } else if (ctrlname==document.getElementById('<%= TextBox2.ClientID %>')) { alert('textbox2 is focus'); } } </script> <asp:TextBox ID="TextBox1" runat="server" onfocus="ctrl(this);"></asp:TextBox> <asp:TextBox ID="TextBox2" runat="server" onfocus="ctrl(this);"></asp:TextBox>
LP MER
Thanks Karthik www.f5Debug.net
Login to post response