MyBB Hacks

Full Version: Listbox conditional
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I'm wondering if it's possible to make a conditional for a listbox.

What I'm trying to do is make it so when a user makes a selection, it will display certian HTML and other xthread fields.

So I made a contact form with a dropdown. If the person chooses "Contact Staff" then it will display only xthread fields that I made for staff.

If they choose "Submit Article" then it will not show any staff related xthread fields.

I was reading the forums and saw how it can be created, but I'm not sure what the values are for the drop down selection.

I saw something like:

Code:
<if $GLOBALS['threadfields']['contus_select'] == 'war' then>
            This is a war zone
<elseif $GLOBALS['threadfields']['contus_select'] == 'safe' then>
this is a safe zone
</if>


I'm not sure where the 'war' and 'safe' values are coming from in this example.

Thanks for the help!

i'm tryng to do the same Frown
This needs to be done in Javascript, and hence not relevant to template conditionals.
I made a simple demo in the Xthreads area : http://mybbhacks.zingaburga.com/showthread.php?tid=5138
Reference URL's