PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ljCharlie
Forum Contributor
Posts: 289 Joined: Wed May 19, 2004 8:23 am
Post
by ljCharlie » Thu Oct 21, 2004 3:15 pm
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
mudkicker
Forum Contributor
Posts: 479 Joined: Wed Jul 09, 2003 6:11 pm
Location: Istanbul, TR
Contact:
Post
by mudkicker » Thu Oct 21, 2004 3:47 pm
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.
ljCharlie
Forum Contributor
Posts: 289 Joined: Wed May 19, 2004 8:23 am
Post
by ljCharlie » Thu Oct 21, 2004 3:55 pm
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
rehfeld
Forum Regular
Posts: 741 Joined: Mon Oct 18, 2004 8:14 pm
Post
by rehfeld » Thu Oct 21, 2004 4:16 pm
disabled="disabled" is the proper attribute and value
that way, even if js is off, it will work