Example: I've created a form for a patient or guardian to submit information to request an appointment.

- The first question on the form, "Is Contact and Patient Information the same?" with Yes, No radio buttons, required.
- The first fieldset is the Contact Information, collapsed.
- The second fieldset is the Patient information, expanded, not collapsible.

What is the best method to auto expand the collapsed Contact Information section upon user input choice of "No"?

Possibly even better UI: Could we hide the whole Contact section (even the link to expand the section) from view until the selection of "No".

CommentFileSizeAuthor
Capture17.JPG43.36 KBcrutch

Comments

oskarblue’s picture

@crutch - I used a guide to accomplish this quite easily: http://drupal.org/node/342183
Good luck!

quicksketch’s picture

Status: Active » Fixed

An excellent guide, thanks oskarblue!

crutch’s picture

Thanks oskarblue!

wolftmc’s picture

Hi, I am working on the very same thing. I noticed in your example you mentioned that you have the field set "collapsed", how did you do that? I have been looking for anything in the documentation but have not found it (sorry if I missed it).

Ideally for what I need to do, we need something like a plus sign for the user to select if they want to complete that part of the form (possible without javascript). I guess what I am trying to create is an expandable form. I hope that makes sense.

Thanks for your advice in advance.

By the way, this is by far one of the best modules, I hope to contribute more as I continue to work with it!

Wolftmc

Marat’s picture

I think this is related somehow to #254728: Conditional fields because there is a condition, if YES do something and if NO do something else.

MBroberg’s picture

There are several good form modules, including:

Multistep, which allows you to define sections of the form for each step. Not sure if it can handle branching steps.

Node form columns, which not only allows you to drag and drop your form elements into columns and regions, but also gives you fine control over hiding and collapsing fields. Very useful!

I don't think either does exactly what you want but they are good options.

Status: Fixed » Closed (fixed)
Issue tags: -expand, -fieldset, -user input

Automatically closed -- issue fixed for 2 weeks with no activity.