Form Fieldsets collapse and expand
Hello, I've been trying to see if we can add an option on the form fieldset to expand and collapse as we click on the fieldset. Is there anyone who has tried doing this? can help us with this request.
Hello, I've been trying to see if we can add an option on the form fieldset to expand and collapse as we click on the fieldset. Is there anyone who has tried doing this? can help us with this request.
No one has actually shown any code, I’ve noticed. 😉
You’d do it like this:
MktoForms2 :: <legend> as toggle
This is essentially making <fieldset><legend> elements act like <details><summary> does natively.
I’m in no way vouching for the UX here, of course. You’d probably want to add additional JS to leave a fieldset in the open state if a value has been filled in. And if any fields are required, you need to open their containing fieldset in onValidate (or else the person will have no idea why the form doesn’t submit!).
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.