Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How would I group an input set? #627

Open
shabaz-ejaz opened this issue Sep 28, 2017 · 6 comments
Open

How would I group an input set? #627

shabaz-ejaz opened this issue Sep 28, 2017 · 6 comments

Comments

@shabaz-ejaz
Copy link

shabaz-ejaz commented Sep 28, 2017

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
Copy link
Author

Any updates on this?

@shabaz-ejaz
Copy link
Author

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

@kevinchappell
Copy link
Owner

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.

@shabaz-ejaz
Copy link
Author

Okay, thanks for letting me know.

@alana314
Copy link

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>')

@danderson421
Copy link

$('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.

This was referenced Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants