Hi!
On the wiki page, I can read "Each option is an object and can be referenced in the eval code with the variable $opt. It has two properties $opt->value and $opt->text"
But how populate several values ?
Context : I have a first field with radiobutton to choose a date. Depending this first choice, CDD search a value (nb max places) and in Eval options I calculate the number of remaining places.
Then, I want to create the dropdown with personal values and labels, but $opt->value and $opt->text only return 1 value and 1 text (label)
Here the end of my code :
As you see I tested different ways, but without success.
Many thanks in advance for your help.
Best regards.
On the wiki page, I can read "Each option is an object and can be referenced in the eval code with the variable $opt. It has two properties $opt->value and $opt->text"
But how populate several values ?
Context : I have a first field with radiobutton to choose a date. Depending this first choice, CDD search a value (nb max places) and in Eval options I calculate the number of remaining places.
Then, I want to create the dropdown with personal values and labels, but $opt->value and $opt->text only return 1 value and 1 text (label)
Here the end of my code :
PHP:
...
for( $i= 0 ; $i <= 10 ; $i++ )
{$s=($i>1 ? 's' : '');$PlaCe=$i.' place'.$s;
$list[]= JHTML::_('select.option', $i, $PlaCe);
$obj[]->text=$i.' place'.$s;
$obj[]->value=$i;
$opt->text=$i.' place'.$s;$opt->value=$i;
}
dump($obj,'Obj');
dump($opt,'opt');
return implode($obj);//return implode($list);
//$opt->text=$obj[]->text;
//$opt->value=$obj[]->value;
Many thanks in advance for your help.
Best regards.