Opened 18 years ago

Closed 18 years ago

#1860 closed defect (fixed)

[zoomdir_-1|0|1_check|select] generates invalid XHTML

Reported by: kristian.thy@… Owned by: sdlime
Priority: high Milestone:
Component: MapServer CGI Version: 4.10
Severity: minor Keywords:
Cc:

Description

The template mechanism gives me the [zoomdir_-1|0|1_check|select] substitution
that is then set as [zoomdir_1_check], [zoomdir_0_check] and [zoomdir_-1_check]
respectively.

Problem is that in order to make valid XHTML Transitional, the checked element
needs to have the attribute checked="checked", while the others need to have no
such attribute. If I make three radio buttons like this:

	<input type="radio" name="zoomdir" value="1" [zoomdir_1_check] />
	<input type="radio" name="zoomdir" value="0" [zoomdir_0_check] />
	<input type="radio" name="zoomdir" value="-1" [zoomdir_-1_check] />

the selected element will get the shorthand attribute checked (with no value
set) which is valid for HTML4. If I do it the XHTML way:

	<input type="radio" name="zoomdir" value="1" checked="[zoomdir_1_check]" />
	<input type="radio" name="zoomdir" value="0" checked="[zoomdir_0_check]" />
	<input type="radio" name="zoomdir" value="-1" checked="[zoomdir_-1_check]" />

the selected zoom direction will get checked="checked", which is good, but the
other two will get checked="", which is illegal.

Suggested fix: Make [zoomdir_-1|0|1_check|select] output 'checked="checked"'
instead of 'checked'.

Change History (5)

comment:1 by sdlime, 18 years ago

Does anyone know if such a change will be ok with "older" implementations of 
HTML (HTML 2.0, HTML 3.0, and HTML 4.0). Is checked="checked" valid in those 
implementations?

Steve

comment:2 by kristian.thy@…, 18 years ago

As far as I can tell from the DTDs checked="checked" is valid; the attribute
minimization in HTML is an option, not mandatory.

comment:3 by sdlime, 18 years ago

Cc: dmorissette@… added
Status: newassigned
Version: 4.84.10
Dan: Any objection to trying this fix in beta 2?

Steve

comment:4 by dmorissette, 18 years ago

As long as the change is kept simple and we don't talk about redoing a bunch of
templating code then yes I think it would be a good idea to fix this for beta2.

comment:5 by sdlime, 18 years ago

Resolution: fixed
Status: assignedclosed
Fixed in CVS HEAD. Will be part of 4.10 beta 2...

Steve
Note: See TracTickets for help on using tickets.