- This topic has 2 replies, 2 voices, and was last updated 3 years, 3 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Stripe payment plugins for your WordPress site
· ·
Home › Forums › Stripe Payments Plugin › Custom field validation
Tagged: Custom Fields
Hi,
We need to add some validation to custom fields – check that two email fields match before allowing a purchase to go ahead.
I have tried adding <script> tags to the description which should accept html according to documentation but these are being rendered as text – possibly for security reasons.
Custom validation should be possible according to this post:
https://s-plugins.com/forums/topic/validate-custom-fields/
Can you let us know how to achieve this please?
I am comfortable with javascript, regex etc. and could probably edit php if necessary.
Thanks,
Nathan
Hi Nathan.
This can be achieved by writing a custom add-on that will handle this.
I have quickly composed an example add-on for you – https://github.com/Arsenal21/stripe-payments-enhancements/releases/tag/0.0.12. Just download .zip file and install it as a normal WP plugin.
The add-on checks if custom field and email field match. If not, it shows error and blocks form submit. Feel free to alter it per your needs.
That’s fantastic – thank you.
And thanks for the quick response!