PDA

View Full Version : Turning a feature on/off with radio button


WorldDomination
01-17-2010, 05:42 PM
I have a feature I want users to be able to choose whether they want it displayed or not. I created a Cutom User profile field and made it a on or off radio button and I used this code:

<if condition="$bbuserinfo['field6'] == On"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script>jqcc=jQuery.noConflict(true);</script> </if>

However it still displays it even if the user has "off" chosen. What did I do wrong?

JamesC70
01-17-2010, 07:36 PM
Use single quotes around the value you're testing for:

<if condition="$bbuserinfo['field6'] == 'On'">

WorldDomination
01-17-2010, 07:48 PM
Okay, I wasn't sure if they were supposed to be there or not, I didn't know how well php handled double quotes. (' and " next to each other.)