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 8532237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:40:12+00:00 2026-06-11T09:40:12+00:00

This should be simple to do, but I can’t seem to find any documentation

  • 0

This should be simple to do, but I can’t seem to find any documentation for it. I am using Rails 3.2 and simple_form. I want to make a form where a user can submit multiple rows of data at once. For example, the form will be:

Animal type: __ Name: _____

I want them to be able submit multiple rows. So they can do:

Animal type:  Dog    Name: Fido
Animal type:  Dog    Name: Charley
Animal type:  Cat    Name: Logan

etc.

The goal is to be able to submit as many items as the user has, with new input rows being created through javascript. I just don’t know how the code is written for the form submit.

  • 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-06-11T09:40:13+00:00Added an answer on June 11, 2026 at 9:40 am

    You’re going to need to do something with javascript. Here’s some code for a jQuery implementation of a similar feature (only for 1 field, you need to adjust accordingly for two):

    jQuery(document).ready(function() {
       jQuery('#linkToClick').click(function() {
       var id_count = document.getElementById('id_count');
       var newIndex = parseInt(id_count);
       var html = '<input type="text" name="type[' + newIndex + '] size=15 />';
       jQuery('#idOfWhereToAdd').before(html);
       id_count.value = newIndex + 1;
       return false;
       }) 
    });
    

    This assumes you have a hidden input on your form, presumably with a value of 0 or 1 and an id of id_count. Also need an a tag (link) with an id of linkToClick.

    Give that a try and let me know how it works.

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

Sidebar

Related Questions

I feel this should be simple but I can't find an answer. I want
This should be a simple problem but I can't seem to find an exact
This should have a simple solution, but I can't seem to find it. I
This should seem simple enough, but can't figure it out. I was porting a
This should be a simple question, but I just can't seem to figure it
This should be simple but I can't find anywhere that tells me how to
I know this should be simple but I can't make it work. I have
This should be really simple, but I can't seem to figure out what to
This should be simple but I can't find a solution: I have a custom
This should be simple.. but can't figure out : I am using rotate function

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.