Page 1 of 1

Array Style

Posted: Tue Mar 02, 2010 2:04 pm
by chris7889
Hello, trying to make my search boxes a set width. I have done this for the 'Select' boxes. As below.

Code: Select all

case '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:250px") );
            break;
I can't seem to get the

Code: Select all

array(style =>"width:250px") );
in the right place for my 'text' searches. Any help would be appreciated.

Code: Select all

case 'Text':
            if ($field->is_search_range && $search) {
                $qf->add('text', $elementName.'_from', $label . ' ' . ts('From'), $field->attributes);
                $qf->add('text', $elementName.'_to', ts('To'), $field->attributes);
            } else {
                $element =& $qf->add(strtolower($field->html_type), $elementName, $label,
                                     $field->attributes, (( $useRequired ||( $useRequired && $field->is_required) ) && !$search));
            }
            break;