This simply wouldn't work because this is how your source would look like.
<input type= "text" name ="ch1" disabled='true'
disabled='false'/>
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
<input type= "text" name ="ch1" <?php if(!S_GET['e'] == 3) {echo "disabled=\"disabled\"";} ?>">
almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
If it is disabled by default and on certain condition, you want to enable it, you have to use javascript.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
As far as I know, once you have printed a html element, you can't change it (unless you use javascript). Even almostbob's code decides whether to enable or disable the textbox at runtime.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
Strangely, http://www.w3schools.com/htmldom/prop_text_disabled.asp says textObject.disabled=true|false
But, when I use <input type= "text" id='ch1' name ="ch1" disabled='false' /> it doesn't work.. It still disables the textbox :S
Anyways, I hope I am wrong and someone else have a way to enable already disabled textbox without using javascript.. :)
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
<input type="text" name="ch1" disabled= "true" id="ch1" />
<?
if( $_GET["e"] == 3 || $_GET["e"] == 4) {
echo "<script>document.getElementById('ch1').disabled = ''; </script>";
}
?>
:)
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356