Open Bug 641973 Opened 14 years ago Updated 12 years ago

Submit button on search pages has a language-dependent "id"

Categories

(Bugzilla :: User Interface, defect)

defect
Not set
minor

Tracking

()

People

(Reporter: gdsotirov, Unassigned)

References

()

Details

User-Agent: Mozilla/5.0 (X11; U; Linux i686; bg; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15 Build Identifier: Bugzilla 4.0 Variable button_name from search/search-advanced.html.tmpl is used both as identifier and value in search/form.html.tmpl and search/knob.html.tmpl. This impacts localization, because when non-Latin symbols are used the page renders with validation warnings for the "id" attribute, but moreover the identifier could be used as CSS # selector. Reproducible: Always Steps to Reproduce: n/a Actual Results: HTML validation warnings, lose of CSS selection Expected Results: Page renders without any warnings
Priority: -- → P4
Version: unspecified → 4.0
Thanks for your report. Could you be more specific about what is wrong? Are you saying that the same "id" value is being used twice?
Yes. There is no duplication of id's, but take look at search/form.html.tmpl: 150: [% IF button_name %] 151: <input type="submit" id="[% button_name FILTER css_class_quote %]_top" 152: value="[% button_name FILTER html %]"> 153: [% END %] If I localize the value of button_name in search/search-advanced.html.tmpl (line 52), then as result I get for example: <input type="submit" id="Търсене_top" value="Търсене"> which results in the following warning from HTML validator: line 352 column 9 - Warning: <input> attribute "id" has invalid value "Търсене_top" because the DTD of HTML 4.01 Transitional requires that: ID and NAME must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). Probably the id should be fixed (e.g. search_top), while only the value of the input tag should be translated? BTW There is duplication of id's v36_req_mysql, v36_req_pg and v36_req_oracle on the release-notes page. It's between the dynamic content for version 4.0 and already static one for version 3.6. I'm catching these, because I'm trying to verify whether I haven't accidentally damaged some templates during translation, but validating the generated pages with the HTML validator extension to Firefox. Usually, the pages do not have any warnings or errors, which is quite good :-)
I'm not sure how to enforce BG language, so I could demonstrate the warning in HTML Markup Validation Service, but I've changed the URL. In English there is only one warning, but you could get more for other languages, because of the localized value of button_name. Let me know if I could help more.
It doesn't make sense to make the field ID language-dependent, I agree.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: P4 → --
Summary: Variable button_name used both for identifiers and values → Submit button on search pages has a language-dependent "id"
You need to log in before you can comment on or make changes to this bug.