Re: [SMARTY] html_options multiple
| From: | messju mohr | Date: | Mon, 17 Mar 2003 15:47:35 +0000 |
| Subject: | Re: [SMARTY] html_options multiple | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8697@lists.php.net to get a copy of this message | ||
On Mon, Mar 17, 2003 at 09:41:07AM +0000, Matt Williams wrote:
> Hi all
>
> I've modified the html_options file to allow multiple select lists (I know passing an
> array as
> $selected would allow multiple option but there seemed
> to be no way of telling if to display as a multiple list).
>
> I also added a class parameter for styling.
>
> I thought this might be of use to somebody.
>
> The changes are.
> line line 39, change the line to
>
> $html_result = sprintf("<select class=\"%s\"
> name=\"%s\"%s>\n%s</select>\n",$class,$name,($multiple == 1)?'
> multiple':'',$html_result);
>
> This allows you to use the attributes multiple=1 to use a multiple select and class=cssclass
> for styling.
>
> Thoughts?
on functions that render html-elements, i often pass-thru all
key/value pairs that are not known to the function as html name="value".
so if there is no reasonable attribute that could be added to "option"
or "optgroup" any unknown parameter could be added to "select". this
would include "multiple", "class" and any obscure html-addition
j.random.designer finds and feels in need to use.
just an idea.
> Matt