my %attributes = ( 'onChange' => 'displaydbfields(' . $n . ')', 'id' => 'coltype' . $n, ); my $v = popup_menu ( -name => 'type', -values => \@COLUMN_TYPES, -default => $col->{type}, -attributes=> \%attributes, );