Hello. In actions I set an array..

and I want select only first line for dropdwon options, that is in a repeater

Why I've some options? Where I wrong?
This is row 3...

And this is row 4

and I want select only first line for dropdwon options, that is in a repeater

Why I've some options? Where I wrong?
This is row 3...

And this is row 4

Hi
Your array is a simple array.
You do have an associative array, like this:
array(0=>'Citroën', 1=>'Peugeot', 2=>'Renault');
Your array is a simple array.
You do have an associative array, like this:
array(0=>'Citroën', 1=>'Peugeot', 2=>'Renault');
HI Colnem, thank you for replay.
With this code
$cars=array
(
array(0=>'Citroën', 1=>'Peugeot', 2=>'Renault'),
array(0=>'Fiat', 1=>'Ford', 2=>'Ferrari')
);
return($cars);
I've same error
With this code
$cars=array
(
array(0=>'Citroën', 1=>'Peugeot', 2=>'Renault'),
array(0=>'Fiat', 1=>'Ford', 2=>'Ferrari')
);
return($cars);
I've same error

One thing like this in php:
$varPhp= array(0=>'Citroën', 1=>'Peugeot', 2=>'Renault');
To return a php var in a form:
$this->set("ieraora", $varPhp);
So, in your Dropdown element, you can use:
{var:ieraora}
$varPhp= array(0=>'Citroën', 1=>'Peugeot', 2=>'Renault');
To return a php var in a form:
$this->set("ieraora", $varPhp);
So, in your Dropdown element, you can use:
{var:ieraora}
Without php, you can do that...
1) In Load/Actions, create a Basic Databuilder
+Value, Type=Variable, Name=tmp, Value=Renault,Citroen, Peugeot
+Value, Type=Variable, Name=tmp, Value={var:split[]:tmp}
2) In Load/View,:
Create your dropdown element
Name=myvar, Options={var:tmp}
Create a submit button
3)in Submit action
create à Message
Content={data.pr:myvar}
You'll find 0 for Renault, 1 for Citroen, 2 for Peugeot
1) In Load/Actions, create a Basic Databuilder
+Value, Type=Variable, Name=tmp, Value=Renault,Citroen, Peugeot
+Value, Type=Variable, Name=tmp, Value={var:split[]:tmp}
2) In Load/View,:
Create your dropdown element
Name=myvar, Options={var:tmp}
Create a submit button
3)in Submit action
create à Message
Content={data.pr:myvar}
You'll find 0 for Renault, 1 for Citroen, 2 for Peugeot
Ok Colnem, the post #397607 not resolve the question.
The post #397608... refers to CF6??
I tried to post a easy question (because i think that is the block) , but really I need of an list of items from a table database, filtered by a value of every repeater.
I thought to print an array ( maybe using a loop) and select every row in a dropdown {var:ieraora.[n]} ??
I hope I was clear. I thank you if you can help me.
The post #397608... refers to CF6??
I tried to post a easy question (because i think that is the block) , but really I need of an list of items from a table database, filtered by a value of every repeater.
I thought to print an array ( maybe using a loop) and select every row in a dropdown {var:ieraora.[n]} ??
I hope I was clear. I thank you if you can help me.
You need to login to be able to post a reply.