![]() |
Checking a profile field's value and executing javascript
I've created a custom profile field with several radio buttons. Each radio button has a text value assigned to it and the user must choose a single value from this list.
I want to branch depending on the string value of this field in a template and execute a separate script based on each value. What I've tried is: Code:
<vb:if condition="$memberinfo['field6'] = 'x'"><script type"text/javascript" src="x.js"></script></vb:if> |
Try changing the single = (declaring a variable) to == (comparing a variable).
|
Thank you. I'm not at all experienced in doing any of this.
--------------- Added [DATE]1461985905[/DATE] at [TIME]1461985905[/TIME] --------------- In the end, in addition to my error with declaring instead of comparing values, I found that I needed to use $bbuserinfo instead of $memberinfo. I still don't understand when to use which. |
Quote:
If you need to apply code for the user of an item (for example on the postbit/postbit_legacy), you could use $post['fieldX'] (= it will return the fieldX value for the user of the post). ;) |
All times are GMT. The time now is 12:47 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|