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 'labels' => { 'contactnum' => 'Contact',
24 #'locationnum' => ' ',
27 { 'field' => 'contactnum',
30 'm2m_method' => 'cust_contact',
31 'm2m_dstcol' => 'contactnum',
32 'm2_label' => 'Contact',
33 'm2_error_callback' => $m2_error_callback,
43 my $display = ($opt{'cust_main'}->residential_commercial eq 'Commercial')
47 my $curuser = $FS::CurrentUser::CurrentUser;
48 my $conf = new FS::Conf;
50 my $m2_error_callback = sub {
51 my($cgi, $object) = @_;
53 #process_o2m fields in process/cust_main-contacts.html
54 my $fields = FS::contact->cgi_contact_fields;
55 my @gfields = ( '', map "_$_", @$fields );
58 if ( /^contactnum(\d+)$/ ) {
60 if ( grep $cgi->param("contactnum$num$_"), @gfields ) {
61 my $x = new FS::contact {
62 'contactnum' => scalar($cgi->param("contactnum$num")),
63 map { $_ => scalar($cgi->param("contactnum${num}_$_")) } @$fields,