check radio button value

More
10 years 4 months ago #42466 by nikotome
Good morning,

How do you check a radio button value from a template?

I've added a Radio Button named "subscripcion", with two possible values (0 and 1). I would like to echo different text in the template according to that value.

Thanks!

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #42467 by ggppdk
Replied by ggppdk on topic check radio button value
Hello

these fields: radio, checkbox, radioimage, checkboximage, select, selectmultiple

the have 'value' but they 'also' have 'label'

see popup description when configuring the field values parameter


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #42468 by nikotome
Replied by nikotome on topic check radio button value
thank you. I understand that, but how do you check the value of the variable? I've tried this:
Code:
<? if ($this->params->get('subscripcion') == 1) { echo "OK"; }

but is not working.

Thanks

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #42469 by nikotome
Replied by nikotome on topic check radio button value
ok, done it my way:
Code:
<? if (($this->item->fields['subscripcion']->display) == "Yes") { echo "yes"; } else { echo "no"; } ?>

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #42471 by ggppdk
Replied by ggppdk on topic check radio button value
Hello

i see now

what you have done depends on current language please use/read this FAQ article:

Using the raw value of a field inside a template file


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.301 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline