kevinchappell / formBuilder

A jQuery plugin for drag and drop form creation
https://formbuilder.online
MIT License
2.59k stars 1.36k forks source link

Fields dependent on others (conditional fields) #478

Open dema121 opened 7 years ago

dema121 commented 7 years ago

Is it possible to add custom properties to fields in order to save which field is dependent on? For example a field must appear only if a checkbox is checked or a date input is greater than something.

Is it planned to implement this feature in formBuilder?

NormanEdance commented 6 years ago

The appearance of the section depending on the radio, select, checkbox value would be cool too, so it would be possible to encapsulate fields into sections.

mmitsui commented 6 years ago

What is the status on this? I just found formBuilder and found it almost suits my needs. :) Except for on this particular issue.

Darthmaul commented 5 years ago

Hello! I am also really in need of this feature. Is this something that could be developed? I could put some work in if need be.

My idea would be to customize the attributes that appear inside the "edit field" view. I'm not sure how to edit this content, and per #669 maybe nobody is...?

My approach would be:

I think this would be a good starting point, and would limit too many failures as you are going to lock it down to be pretty closed types. Additionally, I found this library: https://github.com/renvrant/conditionize.js This library queries off of data-attributes in the constructed forms. While it may be a bad idea to add an external library to this one, I think this is at least something good to look at as a jumping-off point for how to render this on the frontend.

The above mentions the other consideration for this feature. This is both a complicated frontend and backend issue. The rendered forms will have to change a good bit, especially depending on how the conditional fields are showing or hiding.

Anyways, that's my brainstorming on this. I'm going to start digging into the source and see if I can figure it out. Honestly this form builder is so close to exactly what I need, and the only thing I don't have here is the conditional logic. I would love some insight if you have any @kevinchappell as far as how to implement any of this.

Thanks!

DavidPLamas commented 5 years ago

Hello!

Is there any progress on this feature? Are there any plans to make this work in the future? I've been actively using this plugin and I there has been the urge for this type of feature.

Thanks!

kevinchappell commented 5 years ago

@Darthmaul excellent writeup on this, certainly a lot to consider. I have conditional fields working for another form building library and would be willing to port some stuff to formBuilder from it.

@DavidPLamas no progress in formBuilder yet. The edit panel would need to become tabbed to fit conditional settings into it, in my opinion its already too large for some fields.

At the moment I'm focused on conditional fields for Formeo, once 1.0 is released I can look at adding them to formBuilder too.

sivashree commented 5 years ago

Hello, Is there any progress in this feature? I have been using this form builder for the past few months and this feature would be a great addition to the form builder. It is an important requirement of my project too.

chauhanravinder commented 5 years ago

How I add Conditional Logic in Form Builder

ghost commented 4 years ago

Hello, Is there any progress in this feature? I need to add Conditional Logic in Form Builder.

Thanks in advance.

rendezz commented 4 years ago

I am working on a plugin at the moment to add conditional logic. Simple functionality which would suit my needs. Any field can depend on a checkbox, radio or select box. If they are selected, then a field container would become visible and its validation would apply. If thats what people are looking for I can package it up as a deployable alongside formbuilder.

rendezz commented 4 years ago

As promised

https://github.com/rendezz/formbuilder_depends

nahidshaikh46 commented 3 years ago

As promised

https://github.com/rendezz/formbuilder_depends Hi, can you upgrade for two or more field depend on one fields. Thanks & Regards.

nahidshaikh46 commented 3 years ago

Hi, can you upgrade for two or more field depend on one fields. Thanks & Regards.

rendezz commented 3 years ago

Hi, can you upgrade for two or more field depend on one fields. Thanks & Regards.

Unfortunately I don't have much time right now so I won't be looking at this functionality. But you can normally achieve the same by just chaining your depends. A depends on B depends on C. That is B is only seen if C is a value, then A is only seen if B is a value (and obviously seen, thats the chained dependency)

nahidshaikh46 commented 3 years ago

Thanks for reply. but my requirement is C depend on A & B. if both A & B selected then only C will visible.

rendezz commented 3 years ago

Thanks for reply. but my requirement is C depend on A & B. if both A & B selected then only C will visible.

Ok, but unfortunately the change from depend on 1 to depend on n changes the scope enough for the work involved to be quite significant which I don't have time for currently so I won't be able to get to this until I have a current project myself which requires it

AnnysStyle commented 1 year ago

Hello, Is there any progress in this feature? I need to add Conditional Logic in Form Builder. Thanks

ug-code commented 6 months ago

Hello, Is there any progress in this feature? I am also really in need of this feature. Thanks in advance for any help on this.

lucasnetau commented 6 months ago

At the current time there is no work being done on this feature request. PRs are welcome or a Sponsor for the feature.

stephaneroze commented 3 months ago

How much do you need to sponsor this feature @lucasnetau ?

Boffice commented 2 months ago

It is surprising how there is such a low demand on this feature. I love the framework, but conditional logic is main reason I am forced to search for alternatives.