HTML / ERB - Standard Button?

This is a simple question, but I do not know what it is called:

In the picture you can see 2 buttons: screenshot

I want the user to simply enter the email address and password and accept it by pressing return. Is there any way to fix this?

I know there is an option in C #, but I forgot what it is called. (Standard-Button?)

I can’t post a photo .. (You need at least 10 reputation to send images ..)

so: There are 2 text inputs and 2 buttons (Login-Form / Register) eMail - Password - Login-Btn and or-Register-btn. The user enters his email address and password. After that, he clicks “return” to accept, and he logged in. How are options that login-btn the first button to select are selected by pressing "return"?

I hope you understand, but I think this is understandable.


What I use:

  • Ruby on Rails 4
  • HTML
  • HTML.ERB
  • Bootstrap 3

Thank.

+4
source share
1 answer

, , , Rails HTML ; , , HTML

Rails, :


button_to

, URL-. button , HTML :

<%= button_to "New", action: "new" %>
# => "<form method="post" action="/controller/new" class="button_to">
#      <div><input value="New" type="submit" /></div>
#    </form>"

f.submit

, , f.submit, :

<%= form_for @var do |f| %>
    <%= f.submit "Register" %>
<% end %>

, :

<%= f.submit "Text", class: "class" %>
+4

Source: https://habr.com/ru/post/1535165/


All Articles