Values in radio buttons

How can I get the values recorded in the table instead of the labels?

Update: after I exported csv... I see values are recorded in the "_raw" of each element...
is that the case always?

The reason I ask... I have radio buttons where a label shares the same characters...
When I view the list view for the form, I just get the labels.... no values show on the list

I have 10 questions with the same rating point system for each...

Labels: | Needs Development | +/- | Meets | +/- | Exceeds |

Values: | 1 | 2 | 3 | 4 | 5 |

I want to total all of the responses by the values once they submit the form...
from what I see I would use the "_raw" for each radio button element... correct?
 
In fabrik we record the values in the db and display the labels in list/details/form views.

That's not to say that the values are not accessibly, just that for display purposes the labels make more sense.

I want to total all of the responses by the values once they submit the form...
from what I see I would use the "_raw" for each radio button element... correct?
For this you would use a php form plugin:

say you have 3 radio elements, called listname___radio1, listname___radio2 and listname___radio3, with values 1,2,3 and labels one,two,three.
And you want to total these and update a element 'listname___total'. You're php code would look like:
PHP:
$radio1 = (int) '{listname___radio1_raw}';
$radio2 = (int) '{listname___radio2_raw}';
$radio3 = (int) '{listname___radio3_raw}';
$total = $radio1 + radio2 + $radio3;

$formModel->updateFormData('listname___total', $total, true);
I've added this one to the wiki as its a pretty common task that others may want to use as well:

http://fabrikar.com/wiki/index.php/..._buttons_and_placing_the_result_in_an_element

I'm not sure if you needed to know anything else regarding the csv export, or if that was just an introduction to the issue you had regarding values vs labels?

-Rob
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top