Help - Search - Members - Calendar
Full Version: Promo Box Help Needed
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
JCollier
I am seeking to add to the homepage, a promo box. This box will allow a guest to enter a promotion code, and then be directed to the appropriate coupon for printing. Example: if you type in "FOOD31" into the promo box, hit submit, you would be directed to the Food coupon for printing. Type in code "KIDS15", then the free kids meal coupon comes up for printing.

These coupons will be on the hosting site, as an image. Or can be made as an individual page, but hidden unless directed there by the code they entered. I will have these codes printed on fliers, social media, everywhere. But the guest has to go to the website, enter the code they have, and have access to the corresponding coupon.

I am using GoDaddy Website Builder/Instapage, and only have access to the html code in the body.

Any and all help would be greatly appreciated, as I am getting no where fast. If I need to have a third party application to achieve this, that is not a problem either. Just can not find the one I am looking for to complete this task. I am not selling anything online ,therefore do not have a shopping cart, or checkout. Only apps I have found so far deal with checkout.

I have searched for html coding, promo box apps, even tried a few building apps. But all is foreign to me.

www.HappyDaysArcade.com - My Simple Page, in need of a promo box on the bottom

Help Me Please!!

Joshua
Christian J
Is it critical that users are not able to find and print the coupons (by viewing the HTML source) without actually knowing the promo codes? To prevent such snooping you'd need a server-side script, but it sounds like GoDaddy Website Builder doesn't support that. A less secure approach might be done with javascript.

Does each coupon correspond with a single code, or could several codes point to the same coupon?
JCollier
One code per coupon. At the moment, I am planning on two codes, for two different coupons. But in the future, more codes may be added for different coupons.

I'd also need to be able to go in and modify the code (not the coupon) depending on the timing of the special being offered.

I was hoping the coupon could be created as an image, and when the code was entered it would direct them to a page with only that coupon image on it. But that page would need to be hidden.

I'm not too sure how html smart every customer would be, but i don't think it's critical at this point to worry about people finding source coding info.
I am an arcade, offering token specials specifically to certain marketed groups by promo code, and food specials directed to certain people with other promo codes. These codes will be printed on fliers, marketing materials, etc.

In my head this makes sense, but I have no knowledge how to make it happen, or if it's even possible.

I thank you for your time and assistance, godaddy left me stranded.
Christian J
Here's a very basic script for two codes (more can be added). If the promo code is valid, the page will redirect to an image with the file name specified (which doesn't have to be the same as the promo code), otherwise an alertbox will show an error message:

CODE
<script type="text/javascript">
function get_coupon()
{
    var promo=document.getElementById('promo');
    var coupon=document.getElementById('coupon');

    // check promo codes and load coupon images
    coupon.onclick=function()
    {
        if(promo.value=='123') // promo code
        {
            window.location.href='abc.gif'; // coupon file name
        }
        
        else if(promo.value=='456')
        {
            window.location.href='xyz.gif';
        }
        
        // add more "else if":s here if needed

        else
        {
            alert('Invalid promo code'); // error message if wrong code is entered
        }
    }
}
if(window.addEventListener)
{
    window.addEventListener('DOMContentLoaded', get_coupon, false);
}
</script>

<p>
Enter promotion code:
<input type="text" value="" id="promo">
<input type="button" value="Get Coupon" id="coupon">
</p>
<noscript><p>Javascript is required to get the promotion coupons.</p></noscript>





JCollier
THANK YOU!!!!!!
I have a promo box, but keeps sending me to the error 404 page.
I've labeled my coupon image, put the name of the image in the spot you provided. Loaded image to host, but not getting it to show up.
It tries to load www.happydaysarcade.com/imagename.jpg but gives error code.
I will contact the host tomorrow to see where the correct spot for me to load the image to is.

Christian J
The image files should be in the same directory (folder) as the web page. If you want to use another directory for the images the script can be modified.
JCollier
It is all set now. I thank you greatly!! Web host still was giving me a hard time, but with your help, and reading between his words, its resolved.
Christian J
You're welcome!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.