Hi,
Ah, right.
In that case - you could edit the /admin/Plugins/ULTRAGlobals.pm file, find:
Code:
#<%Plugins::ULTRAGlobals::Format_Select_Field($field,'Field')%>
sub Format_Select_Field {
my $current_value = $_[0];
my $field = $_[1];
my $schema = $DB->table('Links')->cols;
my $field_vals = $schema->{$field};
my @select_loop;
for (my $i = 0; $i <= 250; $i++) {
my $tmp;
if (!$field_vals->{form_values}[$i]) { last; }
$tmp->{value} = $field_vals->{form_values}[$i];
$tmp->{name} = $field_vals->{form_names}[$i];
if ($current_value eq $tmp->{name}) { $tmp->{selected} = 1; }
push @select_loop, $tmp;
}
return { select_loop => \@select_loop }
}
..and change like so:
Code:
#<%Plugins::ULTRAGlobals::Format_Select_Field($field,'Field')%>
sub Format_Select_Field {
my $current_value = $_[0];
my $field = $_[1];
my $schema = $DB->table('Links')->cols;
my $field_vals = $schema->{$field};
my @select_loop;
for (my $i = 0; $i <= 250; $i++) {
my $tmp;
if (!$field_vals->{form_values}[$i]) { last; }
$tmp->{value} = $field_vals->{form_values}[$i];
$tmp->{name} = $field_vals->{form_names}[$i];
if ($tmp->{name} =~ /England|Scotland|Wales/) {
$hit->{group_as} = 1;
} if ($current_value eq $tmp->{name}) { $tmp->{selected} = 1; }
push @select_loop, $tmp;
}
return { select_loop => \@select_loop }
}
Then, instead of using:
Code:
<%Plugins::ULTRAGlobals::Format_Select_Field($Test_Select,'Test_Select')%>
<select name="Test_Select">
<%loop select_loop%>
<option value="<%value%>" <%if selected%>selected="yes"<%endif%>><%name%></option>
<%endloop%>
</select>
..try using:
Code:
<%Plugins::ULTRAGlobals::Format_Select_Field($Test_Select,'Test_Select')%>
<select name="Test_Select">
<%loop select_loop%>
<%if group_as%>
<optgroup label="<%name%>">
<%else%>
<option value="<%value%>" <%if selected%>selected="yes"<%endif%>><%name%></option>
<%endif%> <%endloop%>
</select>
Totally untested - but should hopefully do what you need
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work! Want to give me something back for my help? Please see my
Amazon Wish List GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500) Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin |
Pre-Made Template Sets |
FREE GLinks Plugins! Compare our different Plugin packages *new* Free CSS Templates