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

  • Home
  • SEARCH
  • 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 6706239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:29:49+00:00 2026-05-26T07:29:49+00:00

How do I create a submit action in form not by a button (with

  • 0

How do I create a submit action in form not by a button (with submit_tag) and not by an image (image_submit_tag)?

I’d like the submit to be clickable text like a link

Thanks

  • 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-26T07:29:49+00:00Added an answer on May 26, 2026 at 7:29 am

    You would need to do that with javascript, since links are a GET request, not a post request. So let’s say you have the following code:

    <%= form_for @post, :html => { :id => 'form' } do |f| %>
      <div class="field">
        <%= f.label :title %>
        <%= f.text_field :title %>
      </div>
      <div class="field">
        <%= f.label :body %>
        <%= f.text_area :body %>
      </div>
      <div class="actions">
        <a id="submit">Submit</a>
      </div>
    <% end %>
    

    You then need to add the following to one of your javascript files. If you’re using < Rails 3.1, just simply add this to your application.js. If you’re using Rails 3.1, add it to one of the js files in assets/javascripts directory.

    $(function() {
      $('#submit').click(function() {
        $('#form').submit();
      });
    });
    

    That said, you can pass the method option into a link_to method call, to use POST. However, just doing that without javascript will not submit any of the form data. So you would either have to do the above, or use javascript to add the data to the url like you would in a query string.

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

Sidebar

Related Questions

I am using this tutorial to create a login form http://www.ryancoughlin.com/2008/11/04/use-jquery-to-submit-form/ It authenticates against
I have a button element that I've created like so: $submit = new Zend_Form_Element_Button('submit');
If the submit button is clicked, prevent the default action and see if the
I have a form to 'create a tag'. Using the jQuery code below. $(#createtag).submit(function()
I have a form where I'm using Jquery to submit the form to create
UPDATE: See the comment by systempuntoout . The form was missing the submit button.
I am using cakephp and creating a form <?php echo $form->create('User', array('action' => 'cancel'));?>
I want to create a view that contains two forms with their submit buttons.
is there a way to create custom post variables when a user presses submit,
I've created a login submit form in HTML but for some reason user/password autocompletion

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.