...

View Full Version : Quick question about submit buttons.



Grass™
06-01-2007, 04:26 PM
Hey guys how do i set a submit button to unclickable, so they cant click it until a later time? Cheers!

ahallicks
06-01-2007, 04:31 PM
just make the form action to #

BonRouge
06-01-2007, 04:33 PM
<!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>
... or you could just do what Alex said. :)

Grass™
06-01-2007, 04:36 PM
Well I have a line setup like this:



<input type='submit' value='Start Game!' onClick='runGameEngine()'>


Can i not add anything to that like you do with a text box?



<input type='text' size='4' readonly='true'>


Thanks guys for your help!

koyama
06-01-2007, 10:13 PM
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:


<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?)

ikilledsanta
06-02-2007, 02:13 AM
Well I have a line setup like this:



<input type='submit' value='Start Game!' onClick='runGameEngine()'>


Can i not add anything to that like you do with a text box?



<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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum