• Resolved nartoof

    (@nartoof)


    Hi,

    Thank you for your great plugin.

    I’d like to use a custom field validation on the checkout form.

    How can I use your trigger “wpmc_before_switching_tab” to stop the switch_tab function if my custom field is empty ?

    I tried to use preventDefault(), stopPropagation() and return false but the switch_tab function continue to change the tab and section.

    Any idea ?

    Thank you very much.

    Anthony

Viewing 1 replies (of 1 total)
  • Plugin Author Diana Burduja

    (@diana_burduja)

    You can hook some action to the “wpmc_before_switching_tab” trigger when switching the steps, but regardless of your action code, the rest of the “switch_tab” function will still be executed. That is simply how JavaScript works.

    I’m sorry, the “wpmc_before_switching_tab” cannot be used for creating a custom field validation.

    But you can enable the “Validate the fields during each step” option on the “WP Admin -> WooCommerce -> Multi-Step Checkout”. With that option enabled also custom required fields will get picked up and validated before moving to the next step.

Viewing 1 replies (of 1 total)
  • The topic ‘Use trigger “wpmc_before_switching_tab” to return false’ is closed to new replies.