-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Adding two options attributes to a field #825
Comments
What do you want to achieve? What do you want it to look like when you render the form? As presented here, it doesn't make sense I would say. |
For this particular project, we are most interested in form builder's ability to create form json, the idea is to have form builder on a dashboard and use it to create forms that will render on an app.Due to the limitations in the json structure im working with, i am forced to implement the functionality i stated above. What i need is to be able to add the options attribute to any field.From the docs, i've seen that its possible to add the options attribute, but the values have to be hardcoded. I was hoping that there was some workaround for this |
I see, and indeed the resulting json is missing a lot of stuff. I am in the same situation and worked around it with a lot of quirky hacks. Lookup the docs for This gives a nice direction, what's possible: #680 (comment) And last but not least, Finally, you have to find a way to reverse that. Go through your custom JSON, create the Formbuilder minimal JSON object to initialize the form and add custom fields and behaviour via It's not really straight forward. Maybe there is a better way to do it. |
Thanks for the response, was really hoping that i'd avoid having to write hacky code, but looks like there's not much of a choice.Let me try out your suggestion. |
If you got more/different insight please share, that would be great. There is a lot of knowledge hidden in all these issues here :) There is also https://draggable.github.io/formeo/ from the same guy who made this Formbuilder. But it lacks documentation and I doubt it allows what you want, out of the box. |
I have similar requirement in my project. The admin requires to create English and French form in one form-builder. I have created 2 attributes each for labels, helptext, placeholder etc. I need to create one more options attribute. Please share if you have found any workaround. |
@junathakuri I think you should create a separate field for each language and then pick the right language when you render the form (see
|
Thank you for replying. I agree that it's a bit messy (can't help with the requirement though :( ). The issue is not every attribute is going to be different only the editable text attributes in En and Fr. I managed to create for most of the fields, and got stuck with the options. Mainly because there is no simple way to define type for options control like 'text' or 'select'. Nevermind I will find some other way. Thank you very much. |
@junathakuri to your point about defining types for options, youre right. this is not currently possible. Like everything its totally possible but would surely be a breaking change. Maybe we can save this for v3.0 |
Hey there, thanks for taking the time to build this useful library.My question is, is it possible to have two options attributes in a field. I've gone through the docs and i have yet to find anything that can help me achieve this.I would be very grateful if anybody can help me with this.
Environment Details:
Expected Behavior
Actual Behavior
Steps to Reproduce
Screenshot - (optional)
Something Like this..

The text was updated successfully, but these errors were encountered: