Forum Moderators: coopster
This is different from using the MULTIPLE attribute, where more than one value can be chosen in the same select form.
foreach ($users as $user) {
++$j;
$user_data = get_userdata($user->ID);
$userarray[$j] = $user_data->user_nickname;
}
?><select id="userselect[]" name="userselect[]">
<option value="#NONE#">- Select -</option>
<?php foreach($userarray as $wpuser) {
echo '<option value="$wpuser">'.$wpuser.'</option>';
}?>
</select>
<?php }
This function gets called about ten times on the same page, once for each "old username". What I want to do is, provide a list of "wpuser" usernames to choose from for each of the "old usernames"
The code above does not seem to work.
I will greatly appreciate any help.
Thank you.
foreach ($userarray as $wpkey){
print("<select name='userselect[".$wpkey."]'>");
foreach ($userarray as $wpval){
print("<option value='".$wpuser."'>".$wpuser."</option>")
}
print("</select>")
}
See what that does - put it in your form, submit it, then print the results:
print_r($HTTP_POST_VARS['userselect']);