CF V5 - Set Radio Box Options with Variables

wayne.regehr 15 Jan, 2014
I have a form that makes use of a Radio Box. I would like to set the Options of the Radio Box using some variables. This form has a piece of custom code pulling data from the db and set as variables.

I thought I would be able to simply set my variable values to the data array:
$form->data['fieldname'][0]['value'] = $myvariablename


However this was not the case. Is there a syntax issue going on here?
GreyHead 15 Jan, 2014
Answer
Hi Wayne,

I don't quite know what you are trying to do. Is this to set the values for individual radio buttons, or to set which button is pre-selected?

I don't think that you can set the values dynamically in CFv5 (there was an extra tab that allowed that in CFv4).

I think that you could use a Custom element to build a radio button group from your data as a workaround.

Bob
This topic is locked and no more replies can be posted.