1 % unless ( $opt{'js_only'} ) {
3 <INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>">
9 NAME = "<%$name%>_first"
11 VALUE = "<% $contact->first |h %>"
14 <FONT SIZE="-2">First name</FONT>
18 NAME = "<%$name%>_last"
20 VALUE = "<% $contact->get('last') |h %>"
23 <FONT SIZE="-2">Last name</FONT>
27 NAME = "<%$name%>_title"
29 VALUE = "<% $contact->title |h %>"
32 <FONT SIZE="-2">Title/Position</FONT>
36 NAME = "<%$name%>_comment"
38 VALUE = "<% $contact->comment |h %>"
41 <FONT SIZE="-2">Comment</FONT>
51 my $name = $opt{'element_name'} || $opt{'field'} || 'contactnum';
52 my $id = $opt{'id'} || 'contactnum';
54 my $curr_value = $opt{'curr_value'} || $opt{'value'};
57 if ( $opt{'onchange'} ) {
58 $onchange = $opt{'onchange'};
59 $onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/;
60 $onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack. all onchange
61 #callbacks should act the same
62 $onchange = 'onChange="'. $onchange. '"';
67 $contact = qsearchs('contact', { 'contactnum' => $curr_value } );
69 $contact = new FS::contact {};