On 8 November 2011 17:45, J. Bobby Lopez <j...@jbldata.com> wrote:
> I went ahead and ripped out $query->Vars() wherever possible on your
> suggestion.  I have a fair handle now on populating the multi-select
> fields, using $form->get_field() to focus specifically on a single
> field.
>
> I'm using the following to populate the multi-select, which _is_ working:
>
>    $field->options($array_ref);
>
> Though, I still haven't been able to highlight individual options as selected:
>
>    $field->default($array_ref); # not working, but should be
>    $form->default_values({ EmailDL => [ 'myvalue1', 'myvalue2'] }); #
> not working, but should be
>
> I am however, able to set 'selected' on the overall <select> tag, which is 
> odd:
>
>    $field->options($array_ref)->{attributes}->{selected} = 'selected';
>
> ..which generates this in HTML source:
> <select name="EmailDL" id="EmailDL" multiple="multiple" selected="selected">
>
> Although not what exactly what I want, it's helped my sanity somewhat  :)
>
> looked at 'select_multi_value.t' and 'select_multi_default_values.t'
> to make sure the syntax was right, but still no joy with setting
> 'selected' on individual options.
>
> Likely I'm just doing something incorrectly, but no idea what.
> Doesn't seem like it should be too complicated :\

Hi,
Unless you post your code, I can't really help you further!

$field->attributes() is just a dumb hashref, so will accept any
key/value you give it.

Carl

_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to