Support » Fixing WordPress » How to code Dropdown Menu for profile.php?

  • I’m a total novice but I’ve managed to successfully add custom fields to the user profile page except dropdown menus. For example, I want the user to select their age range. I can’t get the selected info from the dropdown to save to the profile (the other custom input fields save fine). What is the proper way to code the dropdown? I’ve tried several different ways trying to follow other examples. Any help will be greatly appreciated. This is what I have now:
    <th scope=”row”><?php _e(‘Age:’) ?></th>
    <select name=”newuser_age” id=”newuser_age”>

    <option value=”under 18″<?php echo $profiledata->user_age ?>>under 18</option>
    <option value=”18-24″<?php echo $profiledata->user_age ?>>18-24</option>
    <option value=”25-34″<?php echo $profiledata->user_age ?>>25-34</option>
    <option value=”35-44″<?php echo $profiledata->user_age ?>>35-44</option>
    <option value=”45-54″<?php echo $profiledata->user_age ?>>45-54</option>
    <option value=”55-64″<?php echo $profiledata->user_age ?>>55-64</option>
    <option value=”65
    or over”<?php echo $profiledata->user_age ?>>65
    or over</option>
    <option value=”65
    or over”><?php echo $profiledata->user_age ?></option>


Viewing 1 replies (of 1 total)
  • Hey, sorry I don’t know the answer but, I recently got the Custom Fields GUI plugin. It allows you to make drop-down custom fields in Write Post. Maybe you can copy something from that.

Viewing 1 replies (of 1 total)
  • The topic ‘How to code Dropdown Menu for profile.php?’ is closed to new replies.