Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Sort select field

Quote Reply
Sort select field
Hi, Iīm using this global sub to generate the select forms

- create_select:
sub {
my $col = shift;
my $tags = GT::Template->tags;
my $cols = $tags->{home}->{db}->cols;
return if (lc $cols->{$col}->{'form_type'} ne 'select');
my $values;
my $selected = $tags->{values}->{$col};
my $form_values = $cols->{$col}->{'form_values'};
my $form_names = $cols->{$col}->{'form_names'};
if ($form_values and $form_names and ($#$form_values == $#$form_names)) {
for my $i (0..$#$form_values) {
exists $values->{@$form_values[$i]} or $values->{@$form_values
[$i]} = @$form_names[$i];
}
}
else {
$values = $cols->{$col}->{values};
}
return $tags->{home}->{disp}->select ( {
name => $col,
values => $values,
value => $selected,
blank => 1,
});
}

But I want to sort the numbers

If itīs less than 10, it be ok 0,1,2,3,4,5,6,7,8,9

But if itīs more than 10 it getīs too confused like 37,38,39,20,21,22,23,40,24,41 (this sequence)

What can I do to sort 11,12,13,14 ... ?

Thanks

Fábio
Subject Author Views Date
Thread Sort select field assombracao 3280 Apr 3, 2002, 8:30 AM
Thread Re: [assombracao] Sort select field
Paul 3225 Apr 3, 2002, 8:42 AM
Thread Re: [Paul] Sort select field
assombracao 3192 Apr 3, 2002, 8:46 AM
Thread Re: [assombracao] Sort select field
Paul 3213 Apr 3, 2002, 8:52 AM
Thread Re: [Paul] Sort select field
assombracao 3201 Apr 3, 2002, 9:06 AM
Post Re: [assombracao] Sort select field
Paul 3183 Apr 3, 2002, 9:07 AM