Skip to content

Instantly share code, notes, and snippets.

@carmoreira
Last active January 25, 2021 16:45
Show Gist options
  • Select an option

  • Save carmoreira/ee474882f7f3ca221ae38535c28de2ae to your computer and use it in GitHub Desktop.

Select an option

Save carmoreira/ee474882f7f3ca221ae38535c28de2ae to your computer and use it in GitHub Desktop.
Make all user information fields mandatory in Advisor Quiz
var inputs = jQuery('.advq_before_results input');
var check = jQuery('.advq_hasemail');
check.css('opacity', '0.7').css('pointer-events', 'none');
inputs.each(function() {
jQuery(this).on('keyup', function() {
var completed = true;
inputs.each(function() {
if (jQuery(this).val() === '') {
completed = false;
}
});
if (completed) {
check.css('opacity', '1').css('pointer-events', 'auto');
} else {
check.css('opacity', '0.7').css('pointer-events', 'none');
}
});
});
//var inputs = jQuery('.advq_before_results input:not([name="advq_askinfo_4_field"])'); - to exclude specific field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment