Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Listbox conditional
erich Offline
Junior Member
**
Posts: 2
Joined: Jul 2015
Post: #1
Listbox conditional
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!

07-29-2015 08:01 AM
Find all posts by this user Quote this message in a reply
isoka Offline
Junior Member
**
Posts: 11
Joined: Mar 2013
Post: #2
RE: Listbox conditional
i'm tryng to do the same Frown
07-30-2015 01:07 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #3
RE: Listbox conditional
This needs to be done in Javascript, and hence not relevant to template conditionals.

My Blog
07-31-2015 03:29 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #4
RE: Listbox conditional
I made a simple demo in the Xthreads area : http://mybbhacks.zingaburga.com/showthread.php?tid=5138


[Image: leelink.gif]
MYBB1.6 & XThreads
08-01-2015 07:17 PM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: