Created
February 13, 2019 03:20
-
-
Save CharlesAMoss/6085fa1110b672effbe63a75ab6243fc to your computer and use it in GitHub Desktop.
word press form
This file contains 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
document.addEventListener( 'wpcf7submit', function( event ) { | |
var inputs = event.detail.inputs; | |
var first = ''; | |
var second = ''; | |
for ( var i = 0; i < inputs.length; i++ ) { | |
if ( 'your-email' === inputs[i].name ) { | |
first = inputs[i].value; | |
} else if ( 'email-confirm' === inputs[i].name ) { | |
second = inputs[i].value; | |
} | |
} | |
if ( first !== second ) { | |
alert( "Your email " + first + " and it's confimation " + second + " do not match" ) | |
break; | |
} | |
}, false ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment