0

I'm currently working on a payment solution using the Typo3-Extension "Powermail". I already added a checkout flow via PayPal. The problem is that you can access this even if the form is not validatet.

Is there a possibility to call the validator or force validation before a submit-button is clicked? (best via javascript) And then ask for the return value (prop. a boolean "true" but I'm not sure) beforer starting the checkout.. I found this online, but I'm not sure how it works or how to call.

*****powermail_validator.data('validator').checkValidity()*****

Thanks in advance!

schew13
  • 11

1 Answers1

1

Everything what comes before submit must be done via JavaScript. And everything that is made with JavaScript isn't secure - especially if you want to add a payment solution. If you aware of it and still want to make a validation before submit, see the manual how to extend powermail with a JS validator: https://docs.typo3.org/typo3cms/extensions/powermail/ForDevelopers/WriteOwnValidators/ClientsideValidation/Index.html Nevertheless: Powermail is just a contactform extension for TYPO3 and not a cart process payment extension. I would think about an individual extension for your needs.

Alex Kellner
  • 1,263
  • 6
  • 11
  • The last comment didn't really sound right.. I know the formvalidation is done via javascript in powermail. This means there is a function which is called when a (submit) button is clicked. And does this function have the possibility to be called with javascript without cklicking a button. For example document.ready function ("dovalidate") ? I hope this describes better what I am searching for :) – schew13 Jan 20 '18 at 13:57
  • The complete JavaScript form validation is made via Parsley JS. There are a lot of options - see the manual: http://parsleyjs.org – Alex Kellner Jan 22 '18 at 11:05