vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Where would I put this code to make drop down menu's be selected a certain option... (https://vborg.vbsupport.ru/showthread.php?t=60948)

AutomatikStudio 01-30-2004 03:37 AM

Where would I put this code to make drop down menu's be selected a certain option...
 
Okay...didn't know what else to name this thread...so let me explain. I have some drop down menu's in Edit Profile in the User CP that have drop down menu's. The user selects what they want from the drop down menu and then submit's it to the database. Now...when the user returns to Edit Profile I'd like those drop down menu's to be selected with what they chose. Either way...I have the code I need to do it...just don't know what file and where to put it. The Birth Date drop down menus in Edit Profile are prime examples of what I'm trying to do.

Natch 01-30-2004 03:57 AM

I think I get your question ...
Code:

<select ...
<option selected="selected" value="currentvalue">Current Name</option>

Right ?

So you need to

PHP Code:

$current ($currentvalue === $userchosenoption) ? "selected='selected'" ""

and then
Code:

<option $current value="currentvalue">Current Name</option>
in each iteration of your array of possible values ...

Make any sense ?

AutomatikStudio 01-30-2004 04:03 AM

Right...I know "how" to do it...thats not the question...the question is where to put my piece of code....in other words...where would i put the "$current....."

Natch 01-30-2004 04:20 AM

in includes/functions_user.php I would have thought ...

AutomatikStudio 01-30-2004 05:17 AM

Well...after looking through the hundreds of lines of functions_user.php...I agree that that is where it would go....but I still can't figure out where....

Natch 01-30-2004 12:37 PM

Do you have a separate function you have written to handle your dropdown menu ?

AutomatikStudio 01-30-2004 01:24 PM

I do not.

Natch 01-30-2004 02:03 PM

Ahhhh - ok so you wanna use the Extra Options facility and add your own test for $current pet ... sorry I had my general query brain in, not my specific query brain LOL

2 secs ... BRB ...

.........

Looking at the function verify_profilefields($formtype = 0), it look slike it should work for custom profile fields just as well as the default ones ... how have u configured your custom field ?

AutomatikStudio 01-30-2004 02:06 PM

Well I haven't used any of the actual custome fields. I just have my new form elements w/ drop down menus and they are named "pettype" and "petgender"...

Natch 01-30-2004 02:08 PM

rite - well as NTLDR has said - https://vborg.vbsupport.ru/showpost....4&postcount=16 - you need to globalise your _POST variables for them to get down into the functions, but why not use a custom field - that way you just need tu extrapolate data from the user table ?


All times are GMT. The time now is 07:33 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01456 seconds
  • Memory Usage 1,729KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete