@JackieDaytona If you're trying to validate fields you can do it on "onclick". This is how I handle it(see below). Now, keep in mind that regardless of whatever method you chose, if PP doesn't "like" the value the button will misfire (the popup will appear and disappear after a second). Unfortunately, there is no way of knowing WHY any given value isn't appreciated by PP, because no error message is thrown back! I had an episode recently where a customer had added an extra space at the end of her email address (I guess she C+V her email address, it happens often that an extra space is copied when you do that), and the button was misfiring...a simple extra space and everything on PP crashed. Pathetic if you ask me, it might happen in the future with phone numbers with crazy extensions, addresses: who knows!! Since we don't get an error back or a formatting/taxonomy guide from PP to know what is "approved" and what isn't, we are just forced to guess and hope for the best. Anyhow, here's how I do it (I use SWAL https://sweetalert.js.org/ instead of the standard alert box, it just looks better): // Render the PayPal button into #paypal-button-container paypal.Buttons({ ....... onClick: function (data, actions) { //make sure all the user's info has been entered if (document.getElementById("txtFname).value == null || document.getElementById("txtFname").value == "") { swal("", "Please enter a Name in the space provided", "info"); return false; }; if (document.getElementById("txtLname").value == null || document.getElementById("txtLname").value == "") { swal("", "Please enter a Last Name in the space provided", "info"); return false; }; if (document.getElementById("txtAddress").value == null || document.getElementById("txtAddress").value == "") { swal("", "Please enter an Address in the space provided", "info"); return false; }; if (document.getElementById("txtZIP").value == null || document.getElementById("txtZIP").value == "") { swal("", "Please enter a ZIP/Postcode in the space provided", "info"); return false; }; if (document.getElementById("txtCity").value == null || document.getElementById("txtCity").value == "") { swal("", "Please enter a City in the space provided", "info"); return false; }; if (document.getElementById("txtState).value == null || document.getElementById("txtState").value == "") { swal("", "Please enter a State/Province/County in the space provided", "info"); return false; }; if (document.getElementById("lstCountry").options[document.getElementById("lstCountry").selectedIndex].value == null || document.getElementById("lstCountry").options[document.getElementById("lstCountry").selectedIndex].value == "") { swal("", "Please select a Country in the space provided", "info"); return false; }; if (document.getElementById("txtTelephone").value == null || document.getElementById("txtTelephone").value == "") { swal("", "Please enter a Telephone number in the space provided", "info"); return false; }; }, ......... }).render('#paypal-button-container');
... View more