if (count($operations) <= 1) {
$element->freeze();
}
- $select = $this->addElement('select', "{$fieldName}_value", NULL,
- $field['options'], array(
- 'size' => 4,
- 'style' => 'min-width:250px',
- )
- );
- $select->setMultiple(TRUE);
+ $this->addElement('select', "{$fieldName}_value", NULL, $field['options'], array(
+ 'style' => 'min-width:250px',
+ 'class' => 'crm-select2',
+ 'multiple' => TRUE,
+ 'placeholder' => ts('- select -'),
+ ));
}
break;
info.target.trigger('change');
}
}
- function initField(selector) {
- return $(selector, $form).css('min-width', '20em').crmSelect2();
+ function initField(selector, removePlaceholder) {
+ var $el = $(selector, $form);
+ if (removePlaceholder !== false) {
+ $el.removeAttr('placeholder');
+ }
+ return $el.css('min-width', '20em').crmSelect2();
}
{/literal}
{foreach from=$config->stateCountryMap item=stateCountryMap}
{rdelim}).on('change', chainSelect);
{/if}
{if $stateCountryMap.country && $stateCountryMap.state_province}
- initField('select[name="{$stateCountryMap.country}"], select#{$stateCountryMap.country}').data('chainSelect', {ldelim}
+ initField('select[name="{$stateCountryMap.country}"], select#{$stateCountryMap.country}', false).data('chainSelect', {ldelim}
callback: CRM.url('civicrm/ajax/jqState'),
target: initField('select[name="{$stateCountryMap.state_province}"], #{$stateCountryMap.state_province}'),
placeholder: "{ts escape='js'}Choose country first{/ts}"