check radio button value

More
4 years 7 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
4 years 7 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 review. Thanks!

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

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

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

More
4 years 7 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 review. Thanks!

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

Moderators: vistamediajoomlacornerggppdk
© 2018 Flexicontent. All Rights Reserved.