![]() |
|
Thread Tools |
#1
|
||||
|
||||
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:
But all of the scripts execute at once. No members have liked this post.
Last edited by m0nde; 30 Apr 2016 at 00:52. Reason: clarification |
#2
|
|||
|
|||
Try changing the single = (declaring a variable) to == (comparing a variable).
|
#3
|
||||
|
||||
Thank you. I'm not at all experienced in doing any of this.
--------------- Added 30 Apr 2016 at 03:11 --------------- 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. No members have liked this post.
|
#4
|
||||
|
||||
Originally Posted by m0nde
You should use $bbuserinfo for the user who load the page.![]()
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). ![]() The following members like this post: MarkFL
|
![]() |
Tags |
conditional, custom field, javascript, vbulletin 4 |
«
Previous Thread
|
Next Thread
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 12:45.