|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
deerwood Smarty n00b
Joined: 25 Apr 2006 Posts: 1
|
Posted: Tue Apr 25, 2006 1:54 am Post subject: html_options can generate invalid X/HTML |
|
|
The docs for html_options (current version 2.6.13) read:
Quote: | If a given value is an array, it will treat it as an html <optgroup>, and display the groups. Recursion is supported with <optgroup>. All output is XHTML compatible. |
While the first 2 sentences are right, the 3rd/last sentence isn't: X/HTML do NOT allow nested <optgroup> elements. Valid children of <optgroup> are only <option> elements.
Thus the docs should be changed at least and contain a big warning about that issue. The code might remain as is, because the W3C some day will allow for nesting and browsers might follow some years later.
Beeing paranoid one could attempt to catch the issue in the code too.
regards, Georg aka deerwood |
|
Back to top |
|
cowboystyle Smarty Rookie
Joined: 02 Oct 2006 Posts: 5 Location: New York, NY
|
Posted: Fri Dec 01, 2006 11:47 pm Post subject: |
|
|
html_options, current version is generating code which is NOT XHTML 1.0 Strict, see here:
This code...
{html_options options=$partners name=type selected=$type}
Is producing this xhtml node...
<select name="type" onChange="" >
Which the W3C doesn't like...
Quote: | <select name="type" onChange="" > there is no attribute "onChange".
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
|
Anyone know what the deal is? |
|
Back to top |
|
TGKnIght Smarty Junkie
Joined: 07 Sep 2005 Posts: 580 Location: Philadelphia, PA
|
|
Back to top |
|
cowboystyle Smarty Rookie
Joined: 02 Oct 2006 Posts: 5 Location: New York, NY
|
Posted: Mon Dec 04, 2006 4:15 pm Post subject: |
|
|
Yup, that's it... here's the "fix" (worked on my companies setup):
Go to: /smarty/templates/plugins directory
Open file: functions.html_options.php
Change line # 95, modify: onChange -> onchange
Weird, this may be my own configuration, I'd like to know if anyone else has the same problem. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Dec 04, 2006 4:27 pm Post subject: |
|
|
cowboystyle wrote: | Yup, that's it... here's the "fix" (worked on my companies setup):
Go to: /smarty/templates/plugins directory
Open file: functions.html_options.php
Change line # 95, modify: onChange -> onchange
Weird, this may be my own configuration, I'd like to know if anyone else has the same problem. |
That's not in the standard shipped Smarty version. |
|
Back to top |
|
TGKnIght Smarty Junkie
Joined: 07 Sep 2005 Posts: 580 Location: Philadelphia, PA
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|