www.webdeveloper.com
Results 1 to 3 of 3

Thread: Onclick button with text.

Hybrid View

  1. #1
    Join Date
    Mar 2013
    Posts
    4

    Onclick button with text.

    Dear Webdeveloper.com readers!

    My name is Keifi, and I'm dutch. I just started my website www.zoveelkorting.nl and I'm doing kinda great.
    This only one thing I'm stuck on.

    I want to make a button that whenever someone clicks on it a ''couponcode '' reveals in the button.
    For example like this one. http://www.vouchercloud.com/bhs-vouc...t-voucher-code

    When you click on '' Get code'' the webshop opens and the code reveals in the button. This is exactly what I want.

    How can I make this? Your help is much appreciated!!

  2. #2
    Join Date
    Mar 2013
    Location
    Denmark
    Posts
    14
    Hello Keifi.
    You would probably need more than HTML to solve this problem if you want a generated cuponcode to appear inside the button.
    I suggest you to try something like this:

    HTML
    HTML Code:
    <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <input type="submit" value="Get cuponcode" name="submit" />
    </form>
    PHP
    Code:
    if (isset($_POST['submit'])) {
    echo '4827482';
    }
    This is a very simple explanation but since you're new, this might give you an idea of how it could be made.
    This code gives you a button and when you press it, the text inside the "echo" statement will be shown beneath the button. If the cuponcode needs to change everytime the button is pressed, then you will need something to generate the code.
    I hope this gives you an idea of how it could be made.
    - PB

  3. #3
    Join Date
    Mar 2013
    Posts
    4
    It's already solved thanks for your answer!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles