Page 1 of 1

How to disable button?

Posted: Thu Oct 21, 2004 3:15 pm
by ljCharlie
Is this how to disable a button?

Code: Select all

$btnNextDisable=" disable";
echo "<input name='btnClick' type='submit' id='btnNext' value='Next -- >' $btnNextDisable>";
It doesn't work though.

ljCharlie

Posted: Thu Oct 21, 2004 3:47 pm
by mudkicker
you can do it with javascript.

Code: Select all

<input name='btnClick' type='submit' id='btnNext' value='Next -- >' onclick='javascript:btnNext.disabled = true;'>
should work.

Posted: Thu Oct 21, 2004 3:55 pm
by ljCharlie
Thanks I got it worked now. I didn't know that the word disable suppose to be disabled with the "d" at the end.

ljCharlie

Posted: Thu Oct 21, 2004 4:16 pm
by rehfeld
disabled="disabled" is the proper attribute and value

that way, even if js is off, it will work