Re: [SMARTY] html_options multiple
| From: | Monte Ohrt | Date: | Mon, 17 Mar 2003 15:53:43 +0000 |
| Subject: | Re: [SMARTY] html_options multiple | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8698@lists.php.net to get a copy of this message | ||
pass-thru is how they should work. The older ones might not work that
way though. Take a look at html_image, it has the functionality that can
be copied.
Monte
On Mon, 2003-03-17 at 09:47, messju mohr wrote:
> 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
--
Monte Ohrt <monte@ispi.net>