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

Conditional fields #1227

Open
jbenito3 opened this issue Mar 19, 2013 · 9 comments
Open

Conditional fields #1227

jbenito3 opened this issue Mar 19, 2013 · 9 comments

Comments

@jbenito3
Copy link
Member

jbenito3 commented Mar 19, 2013

It's a somewhat commonly requested feature to have certain fields (or sections?) in the registration form displayed only when certain other fields are selected (or have a particular value).

For example, you may be able to select between "speaker" and "participant" in a single-choice dropdown field, and depending on what you selected, only fields related to the selected role are shown. Another usecase could be selecting an "Apply for financial aid" checkbox when registering for a conference, which would then show additional (and possibly required) fields to provide more details.

On a more abstract level, this should be implemented in the following way:

  • Each registration form field has a new setting in its configuration dialog, where you can select one other field (e.g. using a dropdown) from the same registration form. Once you selected that field, depending on its type, you can choose which values of that field are needed to enable the current field. In case of a checkbox this would be "checked" or "not checked" (selecting both does not make much sense, but maybe it's not necessary to prohibit that), in case of a choice field any of its choices it would list any of its choices.
  • The form logic (on the React side) takes this into account and hides fields as needed
  • The form validation logic (on the React side) ignores validation errors from inactive fields, and also does not send data for such fields during submission (TBD: what to do when editing a registration and there's already data - keep it or remove it?)
  • On the backend, this needs to be enforced as well
  • Unit tests should be added, in particular on the backend, if there are edge cases or other cases where bugs / unexpected behavior are likely

# Original ticket imported from Trac below:

Would it be difficult to add a capability for conditional fields in the registration form?

For instance,

  • if we check a box or select a radio button --> show other fields
  • even more, if we select a given country --> show extra fields (VISA requirement) [Requested by Jochen Thaeder for QM2014]

As well, a field could trigger to show/hide a different section.

@jbenito3
Copy link
Member Author

Pedro, just to remember when integration the new reg form. And to do only if we find an easy solution.

@pferreir
Copy link
Member

I think that we will have to settle for backend-only for now. UI-wise, this would mean a lot of work at this time.

@pferreir pferreir modified the milestones: v1.9.5, v1.9.6 Sep 8, 2015
@pferreir
Copy link
Member

Related to CHG34395.

@ThiefMaster ThiefMaster removed this from the v1.9.6 milestone Aug 10, 2017
@mvidalgarcia
Copy link
Member

Another request of this feature RQF0813246.

@pferreir pferreir removed their assignment Aug 26, 2019
@paulmenzel
Copy link

Is this on any roadmap?

@ThiefMaster
Copy link
Member

No, it's one of those "would be nice to have, but is not trivial and also adds a LOT of complexity" things...

@paulmenzel
Copy link

No problem. Can you give an estimation, how long you would need to implement it?

@paulmenzel
Copy link

… if you worked on it.

@ThiefMaster
Copy link
Member

I think the hardest part there is to create UI for configuring it. And doing estimates for UI work is pretty hard by itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants