Adding form validation

knutsford
Contributor
Contributor

I am adding form validation using

 

validate: function(actions) {
            actions.disable(); // Allow for validation in onClick()
            paypalActions = actions; // Save for later enable()/disable() calls
},
commit: true,
onClick: function(){
           let val = validateForm(); //returns status from your Custom Validation Checkpoint
          if (val){
                 paypalActions.enable();
         }
        else {
                paypalActions.disable();
               document.getElementById('error').classList.remove('hidden');
      }
},

 

 

The problem I have is taht if the form is valid it enables the PayPAL Button but you have to click it again to go to PayPal. How do I similate the second click you you don't have to click twice?

 

Thanks

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.