0

Can somebody help me please add some text before the default "value" of a multiple select option.

The code that responds for this is:

if (!K2HelperPermissions::canAddItem($categories[$i]->value)) {
$categories[$i]->disable = true;
}

$lists['categories'] = JHTML::_('select.genericlist', $categories_options, 'catid[]', 'multiple="multiple" style="height:150px"', 'value', 'text',$catid );

And here is how the "option" looks now <option value="891">Uncategorized</option>

What I want is to add some text before the letters in value="", so for example it looks like:

<option value="sometext_891">Uncategorized</option>

Can somebody Please help me?

Techie
  • 44,706
  • 42
  • 157
  • 243
Vzlotea
  • 97
  • 2
  • 12

2 Answers2

0

Try with:

$lists['categories'] = JHTML::_('select.genericlist', $categories_options, 'catid[]', 'multiple="multiple" style="height:150px"', 'value', 'text','sometext' . $catid );
Alexander Nenkov
  • 2,910
  • 20
  • 28
0

Before this

$lists['categories'] = JHTML::_('select.genericlist', $categories_options, 'catid[]', 'multiple="multiple" style="height:150px"', 'value', 'text',$catid ); must be cycle or some strings with this:

$categories_options[] = JHTML::_('select.option', option-value, option-text);

if you will edit "value" in this, the values in the select will change

QArea
  • 4,955
  • 1
  • 12
  • 22