Radio button label and heading label

wmackay

New Member
New user here - trying to use element value from another table as radio button label and heading label. Tried placeholder but won't work. Can this be done?
 
New user here - trying to use element value from another table as radio button label and heading label. Tried placeholder but won't work. Can this be done?

Hi Wmackay and welcome to the Fabrik forums.

When you say "Element value from another table" do you mean a databasejoin element?

And with databasejoin elements you can only use them as dropdowns, but in the future radio buttons will be implemented.

BTW I highly suggest getting silver support membership since your questions would be answered a lot quicker, for being a new user. :)
 
Thanks for the reply. The element is not a database join but a radio button defined element. I am trying to label the element with the database value of another element in the same table (sorry I said another table in my initial question but would also like to know if that is possible as well). I've tried placeholder with and without _raw with no luck. I notice I can use placeholders such as {$my->name} but can't get {tablename___elementname} type placeholder to work.
 
Thanks for the reply. The element is not a database join but a radio button defined element. I am trying to label the element with the database value of another element in the same table (sorry I said another table in my initial question but would also like to know if that is possible as well). I've tried placeholder with and without _raw with no luck. I notice I can use placeholders such as {$my->name} but can't get {tablename___elementname} type placeholder to work.

Hi Wmackay,

If $my->name works, that is an object. Try the object way of grabbing an element, such as:

$this->_row->data->yourtable___elementname_raw;

That would be the variable to grab the element name from that row, but since you are not working in a row, try something similar to this, along these lines.

Since I'm not a professional at php, I would have to play around with it.
 
Thanks once again. A new direction is definitely what I need - just spinning my wheels here. I'll give that approach a shot and let you know how I make out. Thanks again for the tips.
 
OK - found a way to do it that works in 'edit element>List settings>Heading label
Here''s the code

<?php
$result = mysql_query('SELECT elementname FROM yourtable');
if (!$result) {
die('Could not query:' . mysql_error());
}
echo mysql_result($result, 0);
?>

however, it doesn't work as element label but it's what I needed.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top