What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
Generating coupon codes with conditional logic update fieldsAsked by cheekyface on October 11, 2014 at 09:42 PM
I'm trying to make a simple coupon code generator to allow customers to generate a code they can forward on to their friends to use and then get a discount.
I figure if I include the email address in the code then it'll keep it relatively unique then add a first name and a coupon title.
I've tried this but I only get zero in the coupon field i've created.
I'm working on this test form - if you could tell me whether I'm wasting my time or not, that would be great.
update fields unique coupon code random code random value
OK - I've just figured it out.
I needed to select (in the advanced options) to "Add field to equation as text by default."
That did it.
I'll share this form for anyone who wants a simple way to generate a coupon code. It seems to do what I need.
I thought I might try to use the unique ID field and add that to the coupon value via the conditional logic but not working. I actually don't see it as an option to insert so I'm wondering if there is a way to make this work?
This is the form editor showing the fields I've created...
This shows what I'm trying to do (the "UNIQUE ID" text represents where I want to insert the unique ID value)
...However when I try to insert the unique ID field, it's not visible in the list of options.
In addition to this you will see the field identified by "clickTo" below. This identity/label is not displayed in any of the settings for fields I've added to the form yet it appears to the ID for the checkbox field I've enetered which is a button checkbox widget. I don't think it has anything to do with the problem but just mentioning this to ensure you that "clickTo" is NOT the unique ID field (which I've labelled as "Coupon Auto")
Any ideas as to how to get the unique ID to display here?
I have already moved your question about Unique ID field from the other thread to a new thread here http://www.jotform.com/answers/441824-Unique-ID-widget-Make-the-hidden-field-shown#0
I would suggest keeping that thread for helping you to change the source code and use the Unique ID field, if that is something you are interested.
Now regarding coupon code.
I would suggest using a widget designed for this, called Random Value Generator.
You can see here how to add a widget to your jotform.
You can see a quick sample of it working here: http://form.jotformpro.com/form/42842757718971
If you want to clone it to your account you can do that by following these steps: How to Clone an Existing Form from a URL.
Do let us know if you have any further questions.
That looks promising. I'll give it a shot.
Just for my own satisfaction - is it possible to use the unique ID field as I was attempting to?
Unfortunately, including Unique ID in the calculation is not possible. You can only select field with input values. Please consider my colleague's suggestion instead :) That should work.