- if ($init) {
- $accno = qq|
- <td><select name="accno_$i" onChange="setTaxkey(this, $i)" style="width:200px" tabindex=|
- . ($i + 5 + (($i - 1) * 8)) . qq|>$form->{chartinit}</select></td>|;
- $tax =
- qq|<td><select id="taxchart_$i" name="taxchart_$i" style="width:200px" tabindex=|
- . ($i + 10 + (($i - 1) * 8))
- . qq|>$form->{taxchart}</select></td>|;
+ $selected_accno = '' if ($init);
+ $selected_taxchart = $taxchart_init unless ($selected_taxchart ne "");
+
+ $accno = qq|<td>| .
+ NTI($cgi->popup_menu('-name' => "accno_$i",
+ '-id' => "accno_$i",
+ '-onChange' => "setTaxkey(this, $i)",
+ '-style' => 'width:200px',
+ '-values' => \@chart_values,
+ '-labels' => \%chart_labels,
+ '-default' => $selected_accno_full))
+ . $cgi->hidden('-name' => "previous_accno_$i",
+ '-default' => $selected_accno_full)
+ . qq|</td>|;
+ $tax = qq|<td>| .
+ NTI($cgi->popup_menu('-name' => "taxchart_$i",
+ '-id' => "taxchart_$i",
+ '-style' => 'width:200px',
+ '-values' => \@taxchart_values,
+ '-labels' => \%taxchart_labels,
+ '-default' => $selected_taxchart))
+ . qq|</td>|;