PirateElf
Technical User
- Jun 30, 2008
- 10
I have been working on this for a minute now and am curious if someone can tell me where I am going wrong.
Basically I am trying to do a dropdown box with perl and I want it to show the current value while still allowing me to add options.
Options are seperated like this: hello | Goodbye | I am confused |
Code:
if ($userDB{$i}->{'FieldType'} == 2) {
my $curval = $userdata{$username}->{$i};
$ucode = qq~<select name="$i" size="$userDB{$i}->{'FieldSize'}"><option value="$curval">$curval</option>~ . join('', map { '<option value=' . ($_ =~ /^\[(.+)\]/ ? 'selected>' . HTMLescape($1) : '>' . HTMLescape($_)) . '</option>' } split(/\|/,$userDB{$i}->{'Options'})) . '</select>';
print FieldsRow ($userDB{$i}->{'DisplayName'} || $i, $ucode);
Basically I am trying to do a dropdown box with perl and I want it to show the current value while still allowing me to add options.
Options are seperated like this: hello | Goodbye | I am confused |