Make first sect of field in past jobs required
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 8 May 2015 20:47:53 +0000 (16:47 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 8 May 2015 20:47:53 +0000 (16:47 -0400)
They are getting ones with nothing entered

config/settings3.php

index a009279..d516e8d 100644 (file)
@@ -10,7 +10,12 @@ $topHeader = [
     . '&sect;391.21(b)(10),(11). <b>All Applicants:</b> start with last, or current'
     . ' position, and work back.'
 ];
-$titles = array_combine(range(1, 4), range(1, 4));
+$titles = [
+    1 => '<label class="error">1</label>',
+    2 => '2',
+    3 => '3',
+    4 => '4'
+];
 $employment_titleHdr = [
     'type'  => 'static',
     'label' => '&nbsp;',
@@ -67,60 +72,65 @@ for ($i = 1; $i <= 4; ++$i) {
         'type'  => 'text',
         'name'  => 'employment_dates_from'.$i,
         'placeholder' => 'From:',
+        'req'   => ($i == 1) ? true: false,
         'grid' => 2
     ];
     ${'employment_dates_to'.$i} = [
         'type'  => 'text',
         'name'  => 'employment_dates_to'.$i,
         'placeholder' => 'To:',
+        'req'   => ($i == 1) ? true: false,
         'grid' => 2
     ];
     ${'employment_info'.$i} = [
         'type'  => 'text',
         'name'  => 'employment_info'.$i,
-//        'placeholder' => '&nbsp;',
+        'req'   => ($i == 1) ? true: false,
         'grid' => 4
     ];
     ${'employment_supervisor'.$i} = [
         'type'  => 'text',
         'name'  => 'employment_supervisor'.$i,
         'placeholder' => 'Supervisor',
+        'req'   => ($i == 1) ? true: false,
         'grid' => 4
     ];
     ${'employment_salary_start'.$i} = [
         'type'  => 'text',
         'name'  => 'employment_salary_start'.$i,
         'placeholder' => 'Starting',
+        'req'   => ($i == 1) ? true: false,
         'grid' => 1
     ];
     ${'employment_salary_end'.$i} = [
         'type'  => 'text',
         'name'  => 'employment_salary_end'.$i,
         'placeholder' => 'Ending',
+        'req'   => ($i == 1) ? true: false,
         'grid' => 1
     ];
     ${'employment_position'.$i} = [
         'type'  => 'text',
         'name'  => 'employment_position'.$i,
-//        'label' => '&nbsp;',
+        'req'   => ($i == 1) ? true: false,
         'grid' => 2
     ];
     ${'employment_position_sub'.$i} = [
         'type'  => 'static',
         'name'  => 'employment_position_sub'.$i,
-//        'label' => '&nbsp;',
+        'req'   => false,
         'grid' => 2
     ];
     ${'employment_reason'.$i} = [
         'type'  => 'text',
         'name'  => 'employment_reason'.$i,
-//        'label' => '&nbsp;',
+        'req'   => ($i == 1) ? true: false,
         'grid' => 2
     ];
     ${'employment_reason_sub'.$i} = [
         'type'  => 'static',
         'name'  => 'employment_reason_sub'.$i,
-//        'label' => '&nbsp;',
+        'req'   => false,
         'grid' => 2
     ];
 }