Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quick question about submit buttons.

    Hey guys how do i set a submit button to unclickable, so they cant click it until a later time? Cheers!

  • #2
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    just make the form action to #
    "write it for FireFox then hack it for IE."
    Quote Originally Posted by Mhtml View Post
    Domains are like women - all the good ones are taken unless you want one from some foreign country.
    Reputation is your friend

    Development & SEO Tools

  • #3
    Regular Coder BonRouge's Avatar
    Join Date
    Mar 2006
    Location
    Sendai, Japan
    Posts
    328
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>just an example</title>
    <script type="text/javascript">
    window.onload=function() {
    document.getElementById('submit').onclick=function() {return false;}
    }
    </script>
    </head>
    <body>
    <form action="process.php">
    <p><input type="submit" id="submit"></p>
    </form>
    </body>
    </html>
    Edit: ... or you could just do what Alex said.
    Last edited by BonRouge; 06-01-2007 at 05:45 PM.

  • #4
    New Coder
    Join Date
    Jun 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well I have a line setup like this:

    Code:
    <input type='submit' value='Start Game!' onClick='runGameEngine()'>
    Can i not add anything to that like you do with a text box?

    Code:
    <input type='text' size='4' readonly='true'>
    Thanks guys for your help!

  • #5
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by Grass™ View Post
    Can i not add anything to that like you do with a text box?
    BonRouge's suggestion is cleaner, but is essentially equivalent to this:
    Code:
    <input type='submit' value='Start Game!' onClick='return false'>
    I guess that it is ok to use the above if you're just looking for a temporary solution (for whatever reason that you want to disable the form?)

  • #6
    New Coder
    Join Date
    May 2005
    Posts
    78
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Grass™ View Post
    Well I have a line setup like this:

    Code:
    <input type='submit' value='Start Game!' onClick='runGameEngine()'>
    Can i not add anything to that like you do with a text box?

    Code:
    <input type='text' size='4' readonly='true'>
    Thanks guys for your help!
    It would be harder to enable to button once you are ready. Setting the form to # could be easily undone with JavaScript.

    Are you trying to make the look where you can tell it is unpushable, like on the IMDB forums, or some download sites? I don't know how to do that, but I'm sure somebody on here does.


  •  

    Posting Permissions

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