• Resolved lphoffmann

    (@lphoffmann)


    How can we disable/enable the submit button based on the conditions if a checkbox is checked or not. This is needed for contact forms to follow GDPR laws.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author philkurth

    (@philkurth)

    Hi @lphoffmann,

    Your best option here is some custom JavaScript. All fields rendered in a field group are targetable using the field keys or names so you can load a simple piece of jQuery on the page that initially checks to see if the required field is checked and toggles the disabled attribute on form button.

    If you only need to prevent the form from being submitted, however, you could rely on ACF’s validation and require the checkbox field be checked. This won’t disable the form button but it will prevent the form from being submitted.

    Cheers,
    Phil

    Thread Starter lphoffmann

    (@lphoffmann)

    Thanks for your answer. I now went for just making the checkbox required first and will add some JS for disabling the button.

    Thanks for your help. Overall, thanks for the great plugin. I hope you will be able to maintain it.

    Plugin Author philkurth

    (@philkurth)

    Thanks @lphoffmann – glad you like it. Advanced Forms has been going strong since 2018 so we’re not going anywhere ??

    Thread Starter lphoffmann

    (@lphoffmann)

    ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘GDPR: Disable button until checkbox is accepted’ is closed to new replies.