• Resolved jamesbw

    (@jamesbw)


    Hi,

    I would like to create a multi step form. In the first step of the form I require 2 separate form blocks. Block 1 will allow a user to enter their personal details. In the separate Block 2 a user is able to enter their current address. I would like a button that allows a user to add additional ‘address’ blocks where they can fill in their address history from the last 5 years. As some users may have lived at the same address for over 5 years, it seems logical to have the option to add additional address blocks for other users.

    Please could anyone tell me how I could achieve this? Here is an example of what I am trying to achieve: https://www.gbvehicleleasing.co.uk/order/personal

    Thanks for any help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @jamesbw

    I hope you are doing well.

    In that case, you will be using the Group field with repeater: https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#field-group

    The Group A will be with the repeater option disabled while Group B enabled it.

    Best Regards
    Patrick Freitas

    Thread Starter jamesbw

    (@jamesbw)

    Hi Patrick,

    Thank you for your help. Your advice has worked a treat!

    I currently have a header named ‘Current Address.’ for my first form. When it repeats I would like the header to change to ‘Previous Address 1’ / ‘Previous Address 2.’ Could you tell me how I could go about this if it is possible please?

    Thanks for any help!

    Plugin Support Laura – WPMU DEV Support

    (@wpmudev-support8)

    Hi @jamesbw

    This wouldn’t be “entirely” possible as there’s no automatic “numbering” of repeated fields and fields labels cannot by “dynamic”.

    A “sort of” workaround could be to use repeater only for those additional (previous) addresses and use that together with conditional logic. Let me explain by example:

    – let’s say that you gather address using “Address” field
    – so you add a “section” field and label it as “Current address”
    – below it you add the Address field – this will be your main/current address
    – below it add a checkbox field with only a single option like “I want to add additionall addresses” and make it not checked by default
    – below add another “Section” field and label it as “Previous addresses”
    – below add a “Field Group” and set label empty
    – inside that Group add another “Address” field, set repeater number etc; you may want to rename repeater buttons to e.g. “Add address” and “Remove address”
    – finally, set visibility condition for those second (“Previous addresses”) section field and for the “Field Group” field (note: for the group, not individual fields inside it) and confiugre it to show those fields only if the checkbox is checked.

    This isn’t exactly what you are looking for but should be relatively closed (minus “numbering”).

    I create an example form for you so you could import it to your site, test and review settings to see how it is configured. You’ll find code to import the example for here

    https://pastebin.com/vgraS79A

    Best regards,
    Adam

    Thread Starter jamesbw

    (@jamesbw)

    Hi Adam,

    Thanks ever so much for your reply. Your solution has worked a treat. Thanks once again!

    Plugin Support Laura – WPMU DEV Support

    (@wpmudev-support8)

    Hi @jamesbw

    I’m glad I could help!

    I’m marking this ticket as resolved then but in case you’d need any more/other assistance, please don’t hesitate to start a new one and we’ll be happy to help.

    Best regards,
    Adam

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Multi step form with conditional logic’ is closed to new replies.