1

Topic: Multiple attribute not being added to Select elements

Hi all,

In the warehouse I have set up a term list and associated sample attribute. I have selected 'Allow Multiple Values'. However when the associated select element is rendered in the browser it is missing the 'multiple' attribute

Any ideas? I could add the attribute onload via jQuery but this seems like a workaround given multiple appears like it should be supported.

Paul Barrington

2

Re: Multiple attribute not being added to Select elements

Hi Paul,

If you have a look at $indicia_templates in client_helpers/helper_base.php you can see there is a 'select' template without the multiple attribute and a 'listbox'  template that does have it.

I would bet that the default template chosen for a lookup-list attribute is 'select' and that it is not switching to 'listbox' when you check 'Allow multiple values'.

I think you should be able to overcome this if you
- go to Survey Datasets,
- locate your survey in the list,
- click the Setup Attributes link,
- locate the attribute in the list,
- click the Survey Settings link and
- change the Default Control Type to 'listbox'.

Jim Bacon.

3

Re: Multiple attribute not being added to Select elements

Awesome Jim, that has done the job. Thanks again. Paul

4

Re: Multiple attribute not being added to Select elements

Hi

Just confirmed my suspicion.
At line 7300 in https://github.com/Indicia-Team/client_ … helper.php as of this moment the default control is a single select regardless of whether it is a multiple value attribute.

It would be easy to change so that the default became a listbox if it is a multiple value attribute. This seems a logical way for it to work to me.

It could have an adverse effect on existing users if they upgraded to this code and had used a multiple value attribute but only wanted to gather single values. Low risk, I think, and it wouldn't actually break. What do you think?

Jim Bacon.

5

Re: Multiple attribute not being added to Select elements

Hi

It makes sense to me as a new user although I have no idea about how many admins might have used a multi as a single in web forms. I imagine they could still override the default as you suggest above to set it back as a single if required.

Paul