I am attempting to stop a drupal form from submitting if two fields don't equate. I have two fields, enter your email and confirm email that both need to match prior to allowing the form to submit. the following code is inside of a $(document).read(function() call. How do I do this?
$('#webform-client-form-27 #edit-submitted-confirm-email-address').blur(function() { if ($('#edit-submitted-email-address').val() == $('#edit-submitted-confirm-email-address').val() ) { $('#edit-submitted-email-address').css('border', '1px solid' ); $('#edit-submitted-email-address').css('border-color', '#848484 #c1c1c1 #e1e1e1' ); $('#edit-submitted-confirm-email-address').css('border', '1px solid' ); $('#edit-submitted-confirm-email-address').css('border-color', '#848484 #c1c1c1 #e1e1e1' ); } else { $('#edit-submitted-email-address').css('border', '2px solid red'); $('#edit-submitted-confirm-email-address').css('border', '2px solid red'); } });