OK, I think I've improved the code ...
I figured I'd forget the onchange event for now and just see if I can update the database with a submit button. Here's my code:
PHP Code:
$profilefield=$DB_site->query_first("SELECT title,description,required,hidden,maxlength,size,displayorder,editable,type,options
FROM profilefield
WHERE profilefieldid=6");
$TheField="";
$optionlines = explode(',', $profilefield[options]);
$option_bit=$optionlines[0];
$TheField = "<select size=\"$profilefield[size]\" name=\"field6\">";
while ($option_bit) {
$option_bit=trim($option_bit);
if ($option_bit == $bbuserinfo[field6]) { $LocOn = "selected"; } else { $LocOn = ""; }
$TheField .= "<option value=\"$option_bit\" $LocOn>$option_bit</option>";
$option_bit=next($optionlines);
}
$TheField .= "</select>";
if ($HTTP_POST_VARS['action']=="Update Matrix") {
$templatesused = 'redirect_updatethanks';
$DB_site->query("UPDATE userfield SET field6=field6 WHERE userid=$bbuserinfo[userid]");
eval("standardredirect(\"".gettemplate("redirect_updatethanks")."\",\"index.php?s=$session[sessionhash]\");");
}
Look at the last query in that code. I don't know how to update "field6" with the current state of the select box. In other words, I choose "Blue" in my select box and then I hit submit. What variable should I use to pass "Blue" into the database?