The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

Want to use a form to process a voucher verification code and save the result and code


This Discussion is public



Hoping for some help please. I want to execute this code within a formidable form. How can I do this? Any help will be appreciated. Tks

<div class="white-block">
<div class="white-block-content">
<form method="post">
<p><?php esc_html_e( 'In order to check for voucher input it into the field bellow and click on Verify', 'couponxxl' ) ?></p>
<div class="input-group">
<label for="voucher_code"><?php esc_html_e( 'Voucher Code', 'couponxxl' ); ?> <span class="required">*</span></label>
<input type="text" name="voucher_code" id="voucher_code" class="form-control" data-validation="required" data-error="<?php _e( 'Please input voucher code', 'couponxxl' ); ?>" value="">
<i class="pline-magnifier"></i>
<a href="javascript:;" class="btn submit-form ajax-return">
<?php esc_html_e( 'Verify', 'couponxxl' ); ?>
<input type="hidden" name="action" value="verify_voucher">
<input type="hidden" name="vendor_id" value="<?php echo esc_attr( $vendor_id ) ?>">
<div class="ajax-response"></div>

There's no executable code in the sample you posted. It's all just HTML and PHP. There's a reference to JavaScript, but there's no JavaScript in that code.

If you want to duplicate what the HTML is doing, just build your form. Follow the tutorials in the documentation.

Discussion closed.