Draggable / formeo

Drag & Drop Form Builder
http://draggable.github.io/formeo/
MIT License
533 stars 196 forks source link

Add Row bugs - IDs not unique, checkboxes and radios merge values, cannot populate values, etc #203

Closed AlexBreskin closed 5 years ago

AlexBreskin commented 5 years ago

Hi there! I'm really close to getting something workable with Formeo but a major requirement we have is the ability for a user of a created form to add multiple of a certain row that the form creator chooses.

Currently I've noticed that the Formeo Render functionality has the option for a form user to duplicate any row with a "+" option. When I tried doing so, I came across several bugs:

  1. If I duplicate a row, it duplicates them with the same element ID and name, giving me no indication as to which duplicate row the values were filled.
  2. Values returned for checkboxes merge together. If there were 3 checkboxes and I've made 3 duplicate rows with this 3, if I answer the first with "2, 3", the second with "1" and the third with "1, 2, 3" the values on post will be (1) [1, 1], (2) [2, 2], (3) [3, 3], which means I cannot attribute them with any particular context in the same row (such as a text field)
  3. Radios become completely unusable as all duplicates will have the same name and all work as if it's one big group, instead of as different groups.
  4. There doesn't seem to be a way to render a form with a set of values other than the base form data, which means I cannot fill a form with user-duplicated rows. If this needs to be a manual process, is there a way to repeat a row?
  5. There is no option visible to delete duplicate rows, but it appears that this option does exist and is functional, just hidden from the form user.

At this stage I've just went ahead and hid the option for a user to duplicate rows until these bugs were sorted. Is there any timeline or priority to this list of bugs being looked into?

Happy to extrapolate further on the above issues

kevinchappell commented 5 years ago

@AlexBreskinRecognite Thanks for the detailed breakdown. PR incoming. With the exception of saving user generated duplicates the issues should be resolved, can you test in #210 ?

The renderer will need a method for collecting userData (similar to formBuilder) that will allow user generated duplicates to be reloaded. A userData getter would probably work best for this rather than allowing users to re-write template data.

AlexBreskin commented 5 years ago

@AlexBreskinRecognite Thanks for the detailed breakdown. PR incoming. With the exception of saving user generated duplicates the issues should be resolved, can you test in #210 ?

The renderer will need a method for collecting userData (similar to formBuilder) that will allow user generated duplicates to be reloaded. A userData getter would probably work best for this rather than allowing users to re-write template data.

Thanks Kevin. Just reviewed these changes in #210

  1. This appears to be working. Now to just get the new unique IDs and Names to fit into the form!
  2. Checkboxes are now filled on their group only, fantastic!
  3. Radios can be duplicated without affecting the original, excellent
  4. Rendering this on my View Responses method doesn't work, but it wasn't really coded for however this is implemented. How would I go about rendering it? My first thought was perhaps I could store the user template data rather than the master template and load that for my ViewResponses form, but I'd love to hear of a more elegant solution if you've implemented one!
  5. There is now a way to delete duplicate rows

By the way, I noticed in the gif in #210 that you have only specific rows with the "Add +" button, but I cannot find a way to set it to specific rows - only all rows (or nothing if I disable the Add + functionality entirely via javascript, which I did in the past).

Thank you so much for implementing these changes and for keeping formeo updated!

kevinchappell commented 5 years ago

:tada: This issue has been resolved in version 1.1.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: