I want to add a coupon code to my form. The code will be the same for everyone, but I don't know how to make sure they enter the right code. Can I even do that?

  1. Go to your form, and then to the text element that you are using for your Coupon Code field. For the purposes of this example, we're going to call the element "CouponCode" (without quotes) in the NAME field underneath the "Label" field.
  2. Put a checkmark in the Validation box, and then click on the radio button to the right of the word 'Custom' in the next line.
  3. Enter an error message (for example: "Please enter a valid coupon code").
  4. Click on "Create code framework." (It doesn't look like a link, but it is!) A javascript popup will appear which says:

Create code framework for validation now?

(Existing code will be appended).

Click on OK.

  1. In the text area that opens, delete all of the code which is currently there, and replace it with:
function ff_CouponCode_validation(element, message)
{
     if (element.value == "ABC123")
     {
          return '';
     }
     return 'Please enter a valid coupon code';
} // ff_CouponCode_validation 

 

Now save the form and test it out!

 

 

 

Special Offer

Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!