Documentation, Reference Materials and Tutorials for WPForms
Have you ever created an order form or donation form, only to have a user accidentally submit a payment of $0? Since the user is unlikely to see the problem when the form is allowed to submit, this could result in confusion and frustration.
In this tutorial, we’ll show you how to require that a form includes an actual payment amount before it can be submitted.
Create an Order Form
To get started, you’ll need to create a new form or edit an existing form.
For this example, we’ll use the Billing/Order Form template.
By clicking on the Total field in the form builder, you can open its Field Options screen. There, you can check the box for Required.
You can then save this form and, if you haven’t done so already, go ahead and embed it on a page.
If you try to run a test submission with a total of $0, you should see the validation error message, “Payment is required.”
That’s it! You can now require that the user has a value in the Total field before they can submit the form.
Next, would you like to offer both Stripe and PayPal payment methods? Follow our guide to let users choose their payment method.