b1fea943 by Jeff Balicki

form validation

1 parent 5b8e13be
...@@ -17204,6 +17204,7 @@ ss3-force-full-width { ...@@ -17204,6 +17204,7 @@ ss3-force-full-width {
17204 max-width: unset !important; 17204 max-width: unset !important;
17205 } 17205 }
17206 17206
17207 [name="acceptance[]"],
17207 [name="contact-about-experience[]"] { 17208 [name="contact-about-experience[]"] {
17208 margin-left: -15px; 17209 margin-left: -15px;
17209 } 17210 }
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -359,4 +359,8 @@ $(window).on('load resize scroll', function() { ...@@ -359,4 +359,8 @@ $(window).on('load resize scroll', function() {
359 359
360 360
361 361
362 });
...\ No newline at end of file ...\ No newline at end of file
362 });
363
364
365
366
......
...@@ -63,5 +63,31 @@ get_template_part( 'global-templates/numbers_hero' ); ...@@ -63,5 +63,31 @@ get_template_part( 'global-templates/numbers_hero' );
63 </div> 63 </div>
64 </div> 64 </div>
65 </div> 65 </div>
66
67 <script type="text/javascript">
68 jQuery( document ).ready(function($) {
69 $('.wpcf7-submit').attr('disabled', 'disabled');
70 $(document).on("change","input , textarea",function() {
71 var empty = false;
72 $('input.wpcf7-validates-as-required').each(function() {
73 if ($(this).val() == '') {
74 empty = true;
75 }
76 });
77 if (!$('input[name="acceptance[]"]').is(":checked")) {
78 empty = true;
79 }
80 if (!$('textarea[name="talk-about"]').val().trim().length > 0) {
81 empty = true;
82 }
83 if (empty) {
84 $('.wpcf7-submit').attr('disabled', 'disabled');
85 } else {
86 $('.wpcf7-submit').removeAttr('disabled');
87 }
88 });
89 });
90 </script>
66 <?php 91 <?php
67 get_footer('numbers'); 92 get_footer('numbers');
93
......
...@@ -690,6 +690,7 @@ height: 87vh; ...@@ -690,6 +690,7 @@ height: 87vh;
690 max-width: unset !important; 690 max-width: unset !important;
691 } 691 }
692 692
693 [name='acceptance[]'],
693 [name='contact-about-experience[]'] { 694 [name='contact-about-experience[]'] {
694 margin-left: -15px; 695 margin-left: -15px;
695 } 696 }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
5 Author: the Understrap Contributors 5 Author: the Understrap Contributors
6 Author URI: https://github.com/understrap/understrap-child/graphs/contributors 6 Author URI: https://github.com/understrap/understrap-child/graphs/contributors
7 Template: understrap 7 Template: understrap
8 Version: 1.1.30372 8 Version: 1.1.30373
9 License: GNU General Public License v2 or later 9 License: GNU General Public License v2 or later
10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html
11 Text Domain: understrap-child 11 Text Domain: understrap-child
......