CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • 'Select' field type - Multiple values
Pages: [1]

Author Topic: 'Select' field type - Multiple values  (Read 1747 times)

Chris7789

  • Guest
'Select' field type - Multiple values
March 05, 2010, 04:17:33 am
Could someone point me in the right direction please?

I would like to make a change that allows for 'Select' field type to store and search multiple values in one field. I know there is a 'Multi-Select' which does this however I really want the drop down box style.

I would either like to change the 'Select' to allow muliple values OR to make a change to 'multi-select' so that it is a drop down menu.

Any help on this would be really really really appreciated.

Unfortunatly my charities budget is 0 so I can't even pay someone to help make these changes like we have done in the past.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: 'Select' field type - Multiple values
March 05, 2010, 07:25:40 am
Quote
I would either like to change the 'Select' to allow muliple values OR to make a change to 'multi-select' so that it is a drop down menu.

How will someone select multiple values for html type "Select" ?

Kurund
Found this reply helpful? Support CiviCRM

Chris7789

  • Guest
Re: 'Select' field type - Multiple values
March 05, 2010, 07:42:11 am
Hi,

Sorry not so they can select mutiple values but so that multiple values can be imported into one field.

e.g.

Select Dropdown shows
1
2
3

And this will search in the field that has potentially all 3 values. Not only one. Kind of looking for a 'Multi-Select' functionality in the style of 'Select'.

Hope that makes a bit of sense. I am guessing the easiest option would be to change the style for 'Multi-Select' so that it shows as a drop down list? Problem is I am really sturggling to achieve this.

Chris7789

  • Guest
Re: 'Select' field type - Multiple values
March 05, 2010, 07:47:44 am
Changing the file. civicrm/CRM/Core/BAO/CustomField.PHP


Code: [Select]
case 'Multi-Select':
          $selectOption =& CRM_Core_OptionGroup::valuesByID( $field->option_group_id );
            $qf->add( 'select', $elementName, $label,
                     array('' => ts('- select -')) + $selectOption,
                     ( ( $useRequired || ($useRequired && $field->is_required) ) && !$search),
                     array(style =>"width:275px") );
            break;

Seems to give me the desired affect of making a 'multi-select' in drop down. Would you reccomend a better way to approach this?
« Last Edit: March 05, 2010, 07:57:51 am by Chris7789 »

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: 'Select' field type - Multiple values
March 05, 2010, 01:02:07 pm
Note that you this will convert all your custom data selects to look like multi-select.

Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • 'Select' field type - Multiple values

This forum was archived on 2017-11-26.