Change Order by Clicking the Tab Key

Asked

Viewed 271 times

1

I’m using bootstrap in a c#project, and when I click the tab key to change the fields the direction is from right to left, and I wanted it to be the other way around, where do I change? Ex: when it arrives in the buttons save and cancel it goes first in cancel and then in save. As an example in the photo below.Nagegação com a tecla TAB

  • The project is ASP.Net MVC?

  • Correct. Asp.net mvc

  • You are using the helpers to generate these fields, right?

  • Thanks @jbueno ! It worked ;)

2 answers

3


You can pass the order of the fields on Html Helpers

@Html.TextBoxFor(model => model.Prop, new { tabindex = 1 })

2

You can use the attribute tabindex="2" in HTML. Example

<!DOCTYPE html>
<html>
<body>

<a href="http://www.w3schools.com/" tabindex="2">W3Schools</a><br>
<a href="http://www.google.com/" tabindex="1">Google</a><br>
<a href="http://www.microsoft.com/" tabindex="3">Microsoft</a>

<p><b>Note:</b> Try navigating the links by using the "Tab" button on you keyboard.</p>

</body>
</html>

  • Thanks @Ricardo and @jbueno! It worked ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.