formBuilder icon indicating copy to clipboard operation
formBuilder copied to clipboard

How would I group an input set?

Open shabaz-ejaz opened this issue 8 years ago • 6 comments

Is it possible to group an input set of data?

Lets day I have the following:

[
  {
    "label": "Protein",
    "name": "protein",
    "showHeader": true,
    "fields": [
      {
        "type": "text",
        "label": "Protein title",
        "className": "form-control"
      },
      {
        "type": "radio-group",
        "name": "radio-group-1506594748152",
        "values": [
          {
            "label": "Yes",
            "value": "yes"
          },
          {
            "label": "No",
            "value": "no"
          }
        ]
      }
    ]
  }
]

If I add drag more than of these input sets onto the canvas then there is no way to tie a field to its group and they all can get muddled up if the user drags them around.

Is it possible for us to simply group each input set?

shabaz-ejaz avatar Sep 28 '17 14:09 shabaz-ejaz

Any updates on this?

shabaz-ejaz avatar Sep 29 '17 08:09 shabaz-ejaz

Would be good if we can get some responses at-least, there are some questions that haven't had any response for a month.

shabaz-ejaz avatar Oct 03 '17 13:10 shabaz-ejaz

Sorry but there is currently no way of doing this and implementing it would be a large undertaking. There is grouping in Formeo but no input sets. I think it would be easier to add input sets to formeo than grouping to formBuilder.

kevinchappell avatar Oct 03 '17 14:10 kevinchappell

Okay, thanks for letting me know.

shabaz-ejaz avatar Oct 03 '17 14:10 shabaz-ejaz

This is not the best solution, but this is what I'm doing: I'm creating header fields as dividers and giving them a class, such as group1start. Then, the next header's parent will have an empty class attribute. So I'm those that to select my elements and wrap them with jQuery: jQuery('.group1start').parent().nextUntil('div[class=""]').addBack().wrapAll('<div id="group1"></div>')

alana314 avatar Oct 25 '17 01:10 alana314

$('div[class=""]').each(function(){ var $set = $(this).nextUntil('div[class=""]').addBack(); $set.wrapAll('<fieldset />'); }); Here's what I'm doing to add a fieldset tag using the weird parent div of any heading that's been added.

danderson421 avatar Jun 25 '21 20:06 danderson421