• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

How to display the value instead of the label?

railer

Member
I have form with a number of radiobutton elements. The labels are Yes, and No.
In the Value field for the Yes option I have a short sentence of text. In the No option, it is just No.

When I view he Detail page of the record, it is displaying the "Yes" label. How to I get it to display the short text sentence?

Thanks!
 
Swap the values and labels.

The labels are what are displayed, the values are what is stored in the database.
 
Swap the values and labels.

The labels are what are displayed, the values are what is stored in the database.
Thanks for your reply Sophist. The problem is that this is a Radiobuttom element, whose labels are "Yes/No". Whereas the value is a text sentence, (correctly stored in the database) wouldn't work in a Yes/No button. Any other ideas? I'm assuming I need code to swap them, yes?
 
Yes, I know. They are radio button elements. In the form, I want the label to say "Yes", but in the Detail view, I want the value to display, but it is saying "Yes" not what was stored in the database. To explain further, here is an example:

Question: Do you offer programs for children at your institution?

Radiobutton configuration:

Value: Offers programs for children Label: Yes
Value: No Label: No

------------
The full feature of this form is: Make the detail page into more of a report in prose, rather than a display of questions and answers.

So this particular question would look like this in the Detail view:

? Offers programs for children.

We would hide the question, entirely.
 
You cannot do what you want directly - the label is what is displayed in both form and views.

Easiest would be to use groups - set the group with the radio buttons to Form only, and make a matching group with calc fields which show the raw value that is shown in Details view only.
 
Hi
I have the same need to display in the list and detail view, the value of the radio button field. Can you explain to me how to do step by step?
Thanks for the support
 
Yes i read the wiki, "Equally this label is shown in the table view rather than the recorded value (which is stored in the database table itself)". this is the question. I would like the value to be shown instead of the label after submited the form, both in the list and in the detail view of the record.
 
Sorry but the value not a numeric but a text string for example (the first label is "no" and value is no, the second label is "yes" and the value is "hello world")...... above solution is the same form my situation?
 
The php for the calc is:
Code:
return '{databasejoin_placeholder_raw}';
where {databasejoin_placeholder} is the placeholder shown in the elements list with "_raw" appended to get the value rather than the label.

You can decide whether you want the databasejoin or the calc or neither shown in the list in the elements' List settings.

To display the label in form but not details, set the Group setting to "Form only".

Put the calc field in a different group which is "Details only".
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top