![]() |
Profile fields with conditions
1 Attachment(s)
Hi everyone. I have a question about adding user profile fields with conditions. What i mean by this is that i want
to add 3 user profile fields with the following types 1)Single-selection radio buttons 2)Single selection menu 3)Single-line text box My goal is to have 2 radio buttons with an Optional Input and add a condition. When the first radio button is selected i want to activate the second profile field which is "Single-selection menu" and if the second radio button is selected i want to activate the third profile field. For example i have a single-selection radio buttons called "Status" with 3 options 1) Student 2) Abiturient 3) Enter your choice. Underneath i have a Single-selection menu called "Univer" with one selection menu and one "Enter your choice. Belove it there's a Single-line text box called "School". 1) When a user sets his/her status as "student" he/she'll activate the Single-selection menu called "Univer" and will be able to choose one option while leaving the third menu called "School" inactive. When saved users will have new profile fields displayed under their usernames such as Status: student Univer: American University (selected option) 2) When a user sets his/her status as "Abiturient" he/she'll activate the third menu called "School" and deactivate the second menu called "Univer". When saved users will have two profile fields displayed under their usernames such as Status: abiturient School: High school of B.g etc 3) When the third optional input is entered under their username there'll be only the third option See the attachment for refferance Attachment 103223 Attachment 103224 Attachment 103225 I already have all indicated fields but i don't know how to achieve that result, please could help me? |
I dont' think you are not going to be able to do that with default vbulletin profile fields. I think you'll have to just write some php code and use some javascript for the input boxes that only show up after x is done.
|
Yes i know that i can't do it with default profiles.
I added this code to postbit PHP Code:
What i wonder is how can i use if conditions correctly to achieve that result. Please could you help me, i am really not good at codding. Please i really need it |
You can try something like:
HTML Code:
<if condition="$post['fieldX'] == 'student'"> |
I'll try now and let you know. Thanks a lot for your help. By the way is there a way to deactivate one field when another is selected?
|
Quote:
|
I get the following erro when trying to use the conditions in my postbit
The following error occurred when attempting to evaluate this template: Code:
Parse error: parse error in C:\wamp\www\students.kg\includes\adminfunctions_template.php(3939) : eval()'d code on line 54 PHP Code:
|
I forgot a single quote:
HTML Code:
<if condition="$post['field7'] == 'student'"> |
woow that seems to work but can i also display the status as well above the univer/scholl
can i do something like this PHP Code:
|
Yes, that should work fine. But, I'd put a <br /> after $post['field7'] so you have a break between lines. You might want to actually put that line before the conditions there since you will always be showing it.
|
All times are GMT. The time now is 01:04 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:
|