I'm having a couple of problems. The first is that I want a multiple-option select on the registration page (and on the edit profile page, of course). I want a user to be able to choose one or more of the options in the select, and I want the UBB to take the selected values and poop out a 16x16 graphic for each. Here is what the select currently looks like:
--------------------------
in public_register_page.pl
--------------------------
<select name="customfield1" multiple size="11">
<option value=1:>not a synesthete
<option value=11:>not sure / not sure what other type(s)
<option value=2:>written symbols evoke synesthesia
<option value=3:>sound evokes synesthesia
<option value=4:>taste evokes synesthesia
<option value=5:>time evokes synesthesia
<option value=6:>sight evokes synesthesia
<option value=7:>smell evokes synesthesia
<option value=8:>touch evokes synesthesia
<option value=9:>temperature evokes synesthesia
<option value=10:>pain evokes synesthesia
</select>
-----------------------
in public_topic_page.pl
-----------------------
after:
$rating_line
~;
I put in:
@syntype = openparencloseparen;
$syntypelen = pushopenparen@syntype, $user_profile[16]closeparen;
$syntype = $user_profile[16];
@syntype = splitopenparen/:/, $user_profile[16]closeparen;
$syntypelen = scalaropenparen@syntypecloseparen;
$synloop = 0;
while openparen$synloop <= $syntypelencloseparen
{
$syntype[$synloop] = scalaropenparen$syntype[$synloop]closeparen;
if openparen$user_profile[16] =~ m/1/g closeparen {
# $syntype = qqopenparencloseparen;
}
if openparen$user_profile[16] =~ m/2/g closeparen {
$syntype = qqopenparen<img src="$vars_config{NonCGIURL}/types/symb.gif" alt="symbols evoke synesthesia" width="16" height="16" border="0">closeparen;
}
if openparen$user_profile[16] =~ m/3/g closeparen {
$syntype = qqopenparen<img src="$vars_config{NonCGIURL}/types/sound.gif" alt="sound evokes synesthesia" width="16" height="16" border="0">closeparen;
}
if openparen$user_profile[16] =~ m/4/g closeparen {
$syntype = qqopenparen<img src="$vars_config{NonCGIURL}/types/taste.gif" alt="taste evokes synesthesia" width="16" height="16" border="0">closeparen;
}
if openparen$user_profile[16] =~ m/5/g closeparen {
$syntype = qqopenparen<img src="$vars_config{NonCGIURL}/types/time.gif" alt="time evokes synesthesia" width="16" height="16" border="0">closeparen;
}
if openparen$user_profile[16] =~ m/6/g closeparen {
$syntype = qqopenparen<img src="$vars_config{NonCGIURL}/types/sight.gif" alt="sight evokes synesthesia" width="16" height="16" border="0">closeparen;
}
if openparen$user_profile[16] =~ m/7/g closeparen {
$syntype = qqopenparen<img src="$vars_config{NonCGIURL}/types/smell.gif" alt="smell evokes synesthesia" width="16" height="16" border="0">closeparen;
}
if openparen$user_profile[16] =~ m/8/g closeparen {
$syntype = qqopenparen<img src="$vars_config{NonCGIURL}/types/touch.gif" alt="touch evokes synesthesia" width="16" height="16" border="0">closeparen;
}
if openparen$user_profile[16] =~ m/9/g closeparen {
$syntype = qqopenparen<img src="$vars_config{NonCGIURL}/types/temp.gif" alt="temp evokes synesthesia" width="16" height="16" border="0">closeparen;
}
if openparen$user_profile[16] =~ m/10/g closeparen {
$syntype = qqopenparen<img src="$vars_config{NonCGIURL}/types/pain.gif" alt="pain evokes synesthesia" width="16" height="16" border="0">closeparen;
}
if openparen$user_profile[16] =~ m/11/g closeparen {
$syntype = qqopenparen<img src="$vars_config{NonCGIURL}/types/other.gif" alt="not sure about syn type" width="16" height="16" border="0">closeparen;
}
$synloop++;
}
and then I put in a:
$row .= qq~
to go back to the rest of the form
---
Now, I can get it to return the first value chosen, but nothing else. (It looks like it's ignoring everything else.) I want it to return ALL the values chosen and poop out a graphic for each.
My SECOND problem is that the form acts as though it's not saving the values. So if I'm editing my profile with this select, and I press "update profile" or whatever it is, and then go back and reload the update profile page, it "unselects" everything I had chosen/saved. Is it not saving the data, not passing the data on, what? ::sighs:: I think I need an array of some sort for it to catch the data in the first place, but I have no idea how to do it / do it and make it work.
(Just FYI, in case it matters: I have eight extra custom fields, the avatar hack, yadda yadda yadda, and everything is just peachy except for when I try to make something into a multiple select.)
Also... Do I need to change anything in any other file (such as the ""customfield1" => 80," in ubb_registration.cgi)? As you can tell, I'm pretty lost at this point.
Thanks for any help!!! =/
_________________________
"If you think it's perfect, I'll fix it." - me