aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes disabled= Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "disabled="false" doesn Watch "disabled="false" doesn New topic
Author

disabled="false" doesn't enable...

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3829
Why disabled="false" doesn't enable radio button? (given that 'disabled' is one of the property of radio button and can have two values 'true' and 'false').

(disabled(false) and disabled:false enable)


Thanks.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3829
disabled = false eable radio button. :roll:
Kj Reddy
Ranch Hand

Joined: Sep 20, 2003
Posts: 1697
Originally posted by rathi ji:
Why disabled="false" doesn't enable radio button? (given that 'disabled' is one of the property of radio button and can have two values 'true' and 'false').

(disabled(false) and disabled:false enable)


Thanks.


I try with the following:
document.searchform.radio1[0].disabled = false;

Its working fine for me.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3829
Originally posted by KJ Reddy:


I try with the following:
document.searchform.radio1[0].disabled = false;

Its working fine for me.


Yes, the above will work. But if we double quote the false (I mean, "false") then it doesn't work.

:roll:
[ June 26, 2006: Message edited by: rathi ji ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56157
    
  13

Originally posted by rathi ji:

But if we double quote the false (I mean, "false") then it doesn't work.


Then don't double-quote it.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Jon Hanlon
Greenhorn

Joined: May 02, 2006
Posts: 8
In HTML boolean attributes such as disabled and readonly can only legally take the name of the attribute.
eg. disabled="disabled" readonly="readonly"
Most browsers however accept any value for the attribute as being in the affimative.
So the following are equivalent:
disabled="disabled"
disabled
disabled="true"
disabled="false"
disabled="unknown"
disabled="23"
disabled="no"

If you want to remove a disabled attribute in script, use the removeAttribute() method.

http://www.w3.org/TR/REC-html40/intro/sgmltut.html#didx-boolean_attribute-1
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56157
    
  13

Originally posted by Jon Hanlon:
In HTML boolean attributes such as disabled and readonly can only legally take the name of the attribute.


I beleive that the OP was talking about Javascript properties (which will expect Javascript boolean values) rather than assigning HTML attributes, but this is a good point for those that will be assigning these values in HTML.
Jon Hanlon
Greenhorn

Joined: May 02, 2006
Posts: 8
Well, if you script

then the non-empty string is cast as boolean true, so it becomes
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56157
    
  13

Yes, as I said. In script, a boolean value is expected. What's your point?
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3829
Originally posted by Jon Hanlon:
Well, if you script

then the non-empty string is cast as boolean true, so it becomes


That's a good point.

 
 
subject: disabled="false" doesn't enable...
 
Similar Threads
I want to submit the button but not refresh the page
java script problem
Enabling a selectList via javascript does not work
Enable-Diable Radio Buttons
How to disable html:checkbox based on html:radio selection