Skip to content

Instantly share code, notes, and snippets.

@CharlesAMoss
Created February 13, 2019 03:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CharlesAMoss/6085fa1110b672effbe63a75ab6243fc to your computer and use it in GitHub Desktop.
Save CharlesAMoss/6085fa1110b672effbe63a75ab6243fc to your computer and use it in GitHub Desktop.
word press form
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