View Full Version : Profile Field Options
MoB Dudditz MD
04-20-2007, 06:39 PM
Does anyone know the values assigned to options
when using the multiple-selection checkbox option?
I was making a profile field of Attendance for Events.
Field: League Attendance:
Option 1
Option 2
Option 3
Option 4
I know how to add a conditional for the field to a template.
<if condition="$post[fieldX"> do something </if>
What I was attempting to achieve was a multiple conditional dependant upon the actual option selection.
<if condition="$post[fieldX option1"> do 1 </if>
<if condition="$post[fieldX option2"> do 2 </if>
Does anyone know the proper way to achieve this?
TY
WhaLberg
04-20-2007, 06:56 PM
Try:
<if condition="$post[fieldx] == option1">do 1</if>
MoB Dudditz MD
04-20-2007, 08:12 PM
Try:
<if condition="$post[fieldx] == option1">do 1</if>
I have been trying different variations to no avail.
My exact profile field addition as follows: [field8]
Multiple-Selection Checkbox titled 'League Attendance' with 3 options as below.
MLG
WSVG
WCG
I have tried both in the template for postbit display:
<if condition="$post[field8] == option1"> do something </if>
<if condition="$post[field8] == MLG"> do something </if>
UPDATE
I removed one of the equal signs since there are multiple allowances and it seems to
be working great so far.
<if condition="$post[fieldX] = option">
WhaLberg
04-20-2007, 08:25 PM
Okay. Every option has an id for Multipe Selection Checkbox. So, you have to use it like that:
<if condition="$post[field8] == x"]do</if>
x there is a number. It may be 1, 2, 3, 4. It is calculated from how you wrote the options.
MoB Dudditz MD
04-20-2007, 08:43 PM
Youre correct.
I was wrong in my original update.
By removing the == all it did was allow things to happen without being dependant
on the selections.
Thank you very much. It works great now by simply providing the number of the option.
<if condition="$post[field8] == x">do</if>
The only problem is that it appears only to work with the first 2 options.
Below I will provide my actual postbit_legacy edit to make things easier.
I am trying to display an image for each selection.
<if condition="$post[field8] == 1"><img src="images/ranks/mlg.png" border="0" /></if>
<if condition="$post[field8] == 2"><img src="images/ranks/wsvg.png" border="0" /></if>
<if condition="$post[field8] == 3"><img src="images/ranks/wcg.png" border="0" /></if>
<if condition="$post[field8] == 4"><img src="images/ranks/egl.png" border="0" /></if>
I have a Multiple-Selction Checkbox in the user profile with four options.
MLG
WSVG
WCG
EGL
hmm... I forgot the options are binary storage so option3 is actually a value of 4
and option 4 is a value of 8.
This thread may have the answers.
http://www.vbulletin.com/forum/showpost.php?p=725845&postcount=2 (http://www.vbulletin.com/forum/showpost.php?p=725845&postcount=2)
WhaLberg
04-21-2007, 09:34 AM
Please read this carefully: http://www.vbulletin.com/docs/html/main/template_conditionals
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.