1 % unless ( $opt{'js_only'} ) {
3 <INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>">
7 % foreach my $field ( @textfields ) {
10 % $value = $item->get($field);
14 NAME = "<%$name%>_<%$field%>"
15 ID = "<%$id%>_<%$field%>"
16 SIZE = "<% $size{$field} || 15 %>"
17 VALUE = "<% scalar($cgi->param($name."_$field"))
21 <BR><FONT SIZE="-1"><% $label{$field} %></FONT>
25 % $value = $item->get('latanum');
26 <TD><% include('/elements/select-table.html',
27 'name_col' => 'description',
32 'field' => "${name}_latanum",
33 'curr_value' => scalar($cgi->param("${name}_latanum"))
37 <BR><FONT SIZE="-1">LATA #</FONT>
39 % $value = $item->get('state');
40 <TD><% include('/elements/select-state.html',
44 'prefix' => "${name}_",
45 'state' => scalar($cgi->param("${name}_state"))
49 <BR><FONT SIZE="-1">State</FONT>
59 my $name = $opt{'element_name'} || $opt{'field'} || 'orderitemnum';
60 my $id = $opt{'id'} || 'orderitemnum';
62 my $curr_value = $opt{'curr_value'} || $opt{'value'};
65 if ( $opt{'onchange'} ) {
66 $onchange = $opt{'onchange'};
67 $onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/;
68 $onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack. all onchange
69 #callbacks should act the same
70 $onchange = 'onChange="'. $onchange. '"';
75 $item = qsearchs('did_order_item', { 'orderitemnum' => $curr_value } );
77 $item = new FS::did_order_item {};
80 my %size = ( 'npa' => 3,
83 tie my %label, 'Tie::IxHash',
84 'quantity' => 'Quantity',
86 'ratecenter' => 'Rate Center',
89 my @textfields = keys %label;