I have CF6 form that displays values retrieved from a database table. The values are shown in a repeater area. One of th ecolumns contains data stored fomr a list of checkboxes. The values in the database are stored as
["value_1","value_2","value_3",....]
When retrieved, they are displayed exactly as that. I would however like them to show up as a text string in the form
"value_1, value_2, value_3,..."
I tried fiddling around with the {data.join:values} and {data.join[,]:values} methods but I can not find the correct way of combining this with the code used for retrieving the values in the repeater area. The code used to retrieve the contents for the field in the repetaer area is
{var:area_repeater42.row.Model.column_name}
So what is the correct code to use in order to have the desired display of this content?
Any help = greatly appreciated!
Erik
["value_1","value_2","value_3",....]
When retrieved, they are displayed exactly as that. I would however like them to show up as a text string in the form
"value_1, value_2, value_3,..."
I tried fiddling around with the {data.join:values} and {data.join[,]:values} methods but I can not find the correct way of combining this with the code used for retrieving the values in the repeater area. The code used to retrieve the contents for the field in the repetaer area is
{var:area_repeater42.row.Model.column_name}
So what is the correct code to use in order to have the desired display of this content?
Any help = greatly appreciated!
Erik
{var.join[, ]:area_repeater42.row.Model.column_name}
Thank you healyhatman, I tried this but the output is still in the format ["value_1","value_2","value_3",....].
OK I get it now. You will need to do it in PHP since it's a json_encoded string and you want it formatted a certain way. {var.jsonde} won't work because reasons.
So I would use a Custom HTML block and you're going to need
So I would use a Custom HTML block and you're going to need
<?phpDO NOT COPY PASTE THIS, type it manually. The forums adds hidden characters.
echo implode(", ", json_decode($this->get("area_repeater42.row.Model.column_name")));
?>
This topic is locked and no more replies can be posted.