Last active
November 18, 2022 06:50
-
-
Save iamrealfarhanbd/f51669d4139473249456d7f082fe0676 to your computer and use it in GitHub Desktop.
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
// output = [email protected] = true; | |
// output = iamfarhan09@gmail = false | |
// output = [email protected] =true | |
//N.B: you have to replace all ids with your form id otherwise it will not work. | |
jQuery(document).ready(function() { | |
jQuery("#fluentform_36 button[type='submit']").attr('disabled', true); | |
jQuery('input#ff_36_email').on("change", function() { | |
const email = jQuery("input#ff_36_email").val(); | |
const regex = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; | |
if(!regex.test(email)) { | |
jQuery("#fluentform_36 button[type='submit']").attr('disabled', true); | |
} else { | |
jQuery("#fluentform_36 button[type='submit']" ).attr('disabled', false); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment