...

View Full Version : Disabling a button onclick



Noonga
03-03-2012, 03:38 AM
What have I done wrong here?


<INPUT id="purchase" onclick="document.getElementById("purchase").disabled = true;" type="submit" value="PURCHASE">

webdev1958
03-03-2012, 03:44 AM
<INPUT id="purchase" onclick="document.getElementById('purchase').disabled = true;" type="submit" value="PURCHASE">


or even easier



<INPUT id="purchase" onclick="this.disabled = true;" type="submit" value="PURCHASE">

Noonga
03-03-2012, 03:45 AM
never mind.

Noonga
03-03-2012, 03:47 AM
The second one was cool. Thanks man!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum