-1

I have around 10 buttons on a web app. IE keeps highlighting the first button by default. I dont want any of the buttons highlighted. I've tried adding this per Stopping IE from highlighting the first submit-button in a form

useSubmitBehavior="false"

which works fine but also disables the postback of the button.

Any other suggestions?

Update:

<asp:Button ID="first_btn" runat="server" Text="Some Text" 
onclick="first_btn_Click" CssClass="button" />
<asp:Button ID="second_btn" runat="server" Text="Some Text" 
CssClass="button" onclick="second_btn_Click" />
<asp:Button ID="third_btn" runat="server" Text="Some Text" 
CssClass="button" onclick="third_btn_Click" />
<asp:Button ID="forth_btn" runat="server" Text="Some Text" 
CssClass="button" onclick="forth_btn_Click" />
<asp:Button ID="fifth_btn" runat="server" Text="Some Text" 
CssClass="button" onclick="fifth_btn_Click" />
Community
  • 1
  • 1
Kieran Quinn
  • 1,085
  • 2
  • 22
  • 49

1 Answers1

-1

Once the page is loaded, trigger

document.getElementById("myButton").focus();

supposing your button is defined as <button id="myButton">Send</button>.

tiktak
  • 1,214
  • 8
  • 15