Created
September 4, 2017 16:57
-
-
Save JarrydLong/b003f6b049b675ca30cb280b52e32461 to your computer and use it in GitHub Desktop.
Enables form validation for all fields. Add the valid variable to the conditional statement before submitting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var valid = 0; | |
| jQuery.each( jQuery("#wpcf_nd .text-input, #wpcf_nd .text-area"), function(){ | |
| if( jQuery(this).val() === "" ){ | |
| jQuery(this).css("border", "1px solid red"); | |
| valid++; | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment