Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1090299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:21:16+00:00 2026-05-16T23:21:16+00:00

Submiting a form <%= submit_tag %> Is there anyway to submit aform using a

  • 0

Submiting a form

<%= submit_tag %> 

Is there anyway to submit aform using a button instead of the submit_tag? Nor do I want to use the image_submit_tag. What other options do I have to submit a form? I understand that the submit_tag produces <input type="submit">.

Thanks in advance.

Edit:
I’m interested in reusing some of my css. I was thinking if it’s possible to use this code below to submit the form. Basically I have css for a button but I want that button to do the submitting of the form. Or do I just rewrite the css for the submit_tag? Thanks for the help.

<%= link_to raw("<span>hello</span>"), root_path, :class=>"button grey"%>

Or is it more logical to just rewrite css for the submit tag?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:21:16+00:00Added an answer on May 16, 2026 at 11:21 pm

    adding a submit button means that pressing “enter” in a field also submits the form. Your other options are input type image, which is the same as submit, just with an image, or programmatically submitting your form with document.getElementById(‘form-id’).submit();. You can hook that javascript on to pretty much anything.

    To flip it around a bit, what are you trying to accomplish?

    So you could attach document.getElementById(‘form-id’).submit(); to onclick for your span and you are golden. The main issue at that point is that hitting enter in a text field will not submit your form (which may or may not be a big deal).

    Ideally, you should style against semantic elements. So if you are making a button style, do it for button elements. It may be worth changing your style for that reason, but at the end of the day, a click handler for the span that submits your form will get the job done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't want to use an <input type=submit /> button to submit a form
I am using a onclick function on my form submit button to hide a
In my application am submiting my form by using post for a php page.
So i'm submiting form with jquery to ifram like this $('.form').submit() here is my
as far as I know there are three methods to submit an HTML form
the form is submiting as normal request instead of Ajax. $(document).ready(function () { StatusComments();
I have a form submit link labeled OK, and I want to have a
I'm submitting a form using an ajax request (POST method), and checking the HTTP
I am getting Error in submitting the form using AJAX and Jquery, following is
I faced the following issue while I submitting my form using jQuery FORM and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.