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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form options, selected and checked, won't validate as XHTML 1

Status
Not open for further replies.

dcnguyen

Technical User
Mar 22, 2005
54
0
0
US
I'm using "selected" and "CHECKED" to pick the default choices among radio buttons and drop-down select menus. However, they don't appear to validate as XHTML 1.0 Transitional:

Code:
# Error  Line 131 column 19: "CHECKED" is not a member of a group specified for any attribute.

				<input CHECKED type="radio" name="radiusDist" id="radiusFeet" onclick="conve

?
# Error Line 142 column 21: the name and VI delimiter can be omitted from an attribute specification only if SHORTTAG YES is specified.

				<option selected value="1" >Jan.</option><option value="2">Feb.</option><opt

Anyway around this?
 
There is. Two things:

1. XHMTL wants every attribute to have a value.
2. XHTML requires all attributes to be lower case.

So:
Code:
 <input [b]checked="checked"[/b] type="radio" name="radiusDist" id="radiusFeet" ... />

<option [b]selected="selected"[/b] value="1" >Jan.</option>

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top