Connecting Tech Pros Worldwide Help | Site Map

style and disabled?

  #1  
Old November 4th, 2005, 04:56 AM
Martin
Guest
 
Posts: n/a
Is disabled to be set in the style of a tag just like visible? I am trying
to set the whole content of a td tag to disabled like this,
style='disabled:true' and it does not seem to work. Is this possible of is
disabled not to be set in style?


  #2  
Old November 4th, 2005, 07:05 AM
RobG
Guest
 
Posts: n/a

re: style and disabled?


Martin wrote:[color=blue]
> Is disabled to be set in the style of a tag just like visible? I am trying
> to set the whole content of a td tag to disabled like this,
> style='disabled:true' and it does not seem to work. Is this possible of is
> disabled not to be set in style?[/color]

It's actually an HTML question, but since you're here...

In the HTML 4 specification, 'disabled' is an attribute of button,
input, optgroup, option, select, and textarea elements. It can have two
values: true or false.

<URL:http://www.w3.org/TR/html4/interact/forms.html#adef-disabled>


It's value can be set in the HTML source (if set, the value is 'true'
and the element is disabled):

<input type="text" .... disabled>

Or by script:

<form ...>
<input type="text" name="textA">
<input type="button" value="Disable textA" onclick="
this.form.textA.disabled = true;
">
...
</form>


If set to 'true', the element is disabled. If set to false, it is
enabled (i.e. is is not disabled).



--
Rob
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disabled property issue with JS objects JohnIdol answers 1 May 21st, 2007 05:59 PM
Setting Style of Disabled Item on Web Form Kubuli John answers 2 November 18th, 2005 03:34 AM
Cannot enable disabled controls with client-side javascript Stu Carter answers 6 November 17th, 2005 08:34 PM
Width attribute for <img> versus <img style="width:..." Gérard Talbot answers 15 August 19th, 2005 12:05 AM