Keyword

Extra field radio button if/else statement

  • shannon briggs
  • shannon briggs's Avatar Topic Author
  • Offline
  • New Member
More
4 years 9 months ago #174920 by shannon briggs
Extra field radio button if/else statement was created by shannon briggs
I'm trying to use an extra field radio button as a switch, but it's just not working correctly for me - always outputting the value "is on" no matter what is selected.

Here's my code:

<?php
$switch = ($this->item->extraFields->switch->value);
if ($switch = ('on')) { ?>
is on
<?php } else { ?>
is off
<?php } ?>

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

More
4 years 9 months ago #174924 by JoomlaWorks
Replied by JoomlaWorks on topic Extra field radio button if/else statement
URL to a page with that value displayed?

The surrounding parentheses to 'on' should be removed by the way. Same for those that wrap the $this->... variable.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum