2 function checkPasswordValidation(fieldid) {
3 var validationResult = document.getElementById(fieldid+'_result').innerHTML;
4 if (validationResult.match(/Password valid!/)) {
13 <& '/elements/validate_password_js.html', &>
15 <DIV ID="contacts_div" STYLE="display:<% $display %>">
17 <FONT CLASS="fsinnerbox-title">Contacts</FONT>
18 <% include('/edit/elements/edit.html',
19 'embed' => $opt{cust_main},
20 'table' => 'cust_main',
22 'submit_id' => $opt{submit_id},
23 'html_table_class' => 'fsinnerbox',
24 'labels' => { 'contactnum' => '', #'Contact',
25 #'locationnum' => ' ',
28 { 'field' => 'contactnum',
31 'custnum' => $opt{cust_main}->custnum,
32 'm2m_method' => 'cust_contact',
33 'm2m_dstcol' => 'contactnum',
34 'm2_label' => ' ', #'Contact',
35 'm2_error_callback' => $m2_error_callback,
45 my $display = ($opt{'cust_main'}->residential_commercial eq 'Commercial')
49 my $curuser = $FS::CurrentUser::CurrentUser;
50 my $conf = new FS::Conf;
52 my $m2_error_callback = sub {
53 my($cgi, $object) = @_;
55 #process_o2m fields in process/cust_main-contacts.html
56 my $fields = FS::contact->cgi_contact_fields;
57 my @gfields = ( '', map "_$_", @$fields );
60 if ( /^contactnum(\d+)$/ ) {
62 if ( grep $cgi->param("contactnum$num$_"), @gfields ) {
63 my $x = new FS::contact {
64 'contactnum' => scalar($cgi->param("contactnum$num")),
65 map { $_ => scalar($cgi->param("contactnum${num}_$_")) } @$fields,