Dear Friends,
I have a problem. In one of my asp.net form, I have two buttons 'reset' and 'submit' and approx 20 textboxes. through javascript, I am setting focus on first textbox. What I am seeing that cursor is blinking in the first text box, and my first button 'reset' also have focus. I want this focus should be on the second button but I am not able to do that. can somebody please help me on this. I am using asp.net 1.1. Other thing is that I have to use only asp:button and not html buttons. My code is like below:
<body MS_POSITIONING= "GridLayout ">
<form id="Banner" method="post" runat="server">
<asp:button id="btn1" Runat="server" Text="Button1"> </asp:button>
<BR>
<BR>
<BR>
<asp:button id="btn2" Runat="server" Text="Button2"> </asp:button><br>
<asp:TextBox id="txt" Runat="server"> </asp:TextBox>
<BR>
<asp:TextBox id="Textbox1" Runat="server"> </asp:TextBox>
<BR>
<asp:TextBox id="Textbox2" Runat="server"> </asp:TextBox>
<BR>
</form>
<script language="javas cript" type="text/javascript">
document.getEle mentById('txt') .focus();
</script>
</body>
I have a problem. In one of my asp.net form, I have two buttons 'reset' and 'submit' and approx 20 textboxes. through javascript, I am setting focus on first textbox. What I am seeing that cursor is blinking in the first text box, and my first button 'reset' also have focus. I want this focus should be on the second button but I am not able to do that. can somebody please help me on this. I am using asp.net 1.1. Other thing is that I have to use only asp:button and not html buttons. My code is like below:
<body MS_POSITIONING= "GridLayout ">
<form id="Banner" method="post" runat="server">
<asp:button id="btn1" Runat="server" Text="Button1"> </asp:button>
<BR>
<BR>
<BR>
<asp:button id="btn2" Runat="server" Text="Button2"> </asp:button><br>
<asp:TextBox id="txt" Runat="server"> </asp:TextBox>
<BR>
<asp:TextBox id="Textbox1" Runat="server"> </asp:TextBox>
<BR>
<asp:TextBox id="Textbox2" Runat="server"> </asp:TextBox>
<BR>
</form>
<script language="javas cript" type="text/javascript">
document.getEle mentById('txt') .focus();
</script>
</body>
Comment