How to create multiple forms for Single Model and all forms must be submitted by one submit button?

dharin

I need to Add multiple records of one Model on a single submit button.

For Example

I need user to create multiple tasks at the end of the day. Each of these tasks has few attributes and what I need is a "Add another task" link or button to add another task record.

In short User Experience is very Similar to Standard Nested Form procedure.

Task does not have any parent resource which I could use in real world.

Task belongs_to 'user' and 'project' but actually they are not parent to the Task as I am not creating any record of User or Project while creating Task.

I do not want to limit the recursion of the form controls with "10.times" etc. as that is not right approach.

George

If you want only a submit button, then it's only one form (this is how HTML forms work).

If I understood right your request, here is a suggestion:

  • use javascript on a button on the page, to create more and more tasks, with an incrementing parameter
  • the submit button should point to a controller's method which creates them all, identifying them by that incrementing parameter

Also, you could create the tasks using AJAX, but this means they will go to the database right away.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Submit multiple forms by single button

From Dev

Multiple Forms, check input from all with one submit button

From Dev

How can I have one submit button for multiple forms?

From Dev

Multiple forms and submit buttons, but only one gets submitted?

From Dev

Django multiple forms with one submit button

From Dev

Rails - Submitting multiple forms with one submit button

From Dev

Rails submit multiple nested forms with one submit button

From Dev

Forms must contain a submit button or an image button

From Dev

Send Multiple forms (edit multiple objects) in one Submit button (Ruby)

From Dev

Two forms - one submit button?

From Dev

Three forms submitting all together by one submit button

From Dev

Is it possible to submit multiple forms with post-action with one button?

From Dev

Is it possible to submit multiple forms with post-action with one button?

From Dev

How to submit forms using radio button one at a time

From Dev

Single Submit button for forms in different Views in MVC

From Dev

How to create submit button in PHP using HTML forms?

From Dev

Multiple update forms for one model

From Dev

Submit n forms With one button MVC .NET

From Dev

2 forms with one submit button $_POST method

From Dev

Rails one model multiple forms one page

From Dev

How to add one button to all of my forms in c#

From Dev

jQuery submits only one form when multiple forms are submitted

From Dev

Using one script for multiple forms on a single page

From Dev

How can i submit all cloned forms?

From Dev

Two html forms one submit button for one results page

From Dev

How do i submit mulitple forms, using the same action, using a single button

From Dev

submit multiple forms by ajax

From Dev

submit multiple forms by ajax

From Dev

Combining multiple forms to submit

Related Related

  1. 1

    Submit multiple forms by single button

  2. 2

    Multiple Forms, check input from all with one submit button

  3. 3

    How can I have one submit button for multiple forms?

  4. 4

    Multiple forms and submit buttons, but only one gets submitted?

  5. 5

    Django multiple forms with one submit button

  6. 6

    Rails - Submitting multiple forms with one submit button

  7. 7

    Rails submit multiple nested forms with one submit button

  8. 8

    Forms must contain a submit button or an image button

  9. 9

    Send Multiple forms (edit multiple objects) in one Submit button (Ruby)

  10. 10

    Two forms - one submit button?

  11. 11

    Three forms submitting all together by one submit button

  12. 12

    Is it possible to submit multiple forms with post-action with one button?

  13. 13

    Is it possible to submit multiple forms with post-action with one button?

  14. 14

    How to submit forms using radio button one at a time

  15. 15

    Single Submit button for forms in different Views in MVC

  16. 16

    How to create submit button in PHP using HTML forms?

  17. 17

    Multiple update forms for one model

  18. 18

    Submit n forms With one button MVC .NET

  19. 19

    2 forms with one submit button $_POST method

  20. 20

    Rails one model multiple forms one page

  21. 21

    How to add one button to all of my forms in c#

  22. 22

    jQuery submits only one form when multiple forms are submitted

  23. 23

    Using one script for multiple forms on a single page

  24. 24

    How can i submit all cloned forms?

  25. 25

    Two html forms one submit button for one results page

  26. 26

    How do i submit mulitple forms, using the same action, using a single button

  27. 27

    submit multiple forms by ajax

  28. 28

    submit multiple forms by ajax

  29. 29

    Combining multiple forms to submit

HotTag

Archive