FROM CACHE - en_header

Is there a way to validate form before click on "form | payment_button" triggers?

12 0 2

Hi all,

As we all know "form | payment_button" adds a dynamic checkout button to the site. The problem I am having is that, I would like to validate the form data, and make sure all of the fields are filled, before the dynamic checkout button triggers and the order is created.

For example, for a regular "Add to cart" button, I can just open up the theme and add my own form validation code. This way it is guaranteed that the customer cant add items to the basket unless they fill out the form.

On the other hand, the function for dynamic checkout button ("form | payment_button") is added dynamically. So I cant validate the form before someone clicks the button. I would like to validate the form data before "form | payment_button" takes the client away.

Is it possible to do that?

Thanks in advance.

Replies 0 (0)