Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using 'disabled' in form textbox not valid xhtml

Status
Not open for further replies.

vasox56

Technical User
Joined
May 8, 2007
Messages
75
Location
GB
hi.. i have a tickbox that enables and disables a textbox..

when it is ticked the user can type in it.. when unticked they cannot type in it.

the tutorial i found said that the textbox should start disabled.. so i use the following code and it works.. problem is the disabled part is not valid..

is there something i can add such as..

status="disabled".. or something like that.. cheers.

Code:
<p><input disabled style="margin-left:20px;width:200px;" type="text" class="txtbox" id="nameboard" name="nameboard" /></p>
 
the error

Below are the results of checking this document for XML well-formedness and validity.

1. Error Line 344 column 19: the name and VI delimiter can be omitted from an attribute specification only if SHORTTAG YES is specified.

<p><input disabled style="margin-left:20px;width:200px;" type="text" class="txtb

"VI delimiter" is a technical term for the equal sign. This error message means that the name of an attribute and the equal sign cannot be omitted when specifying an attribute. A common cause for this error message is the use of "Attribute Minimization" in document types where it is not allowed, in XHTML for instance.

How to fix: For attributes such as compact, checked or selected, do not write e.g <option selected ... but rather <option selected="selected" ...
 
change to:

Code:
<input disabled[red]="disabled"[/red] style="margin-left:20px;width:200px;" type="text" class="txtbox" id="nameboard" name="nameboard" />



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top