Hide Checkbox Validation Tip on User Click
-
Password to enter website: [ redacted ]
Hi, Sorry not quite sure where to add this topic.
I have successfully added some jquery to my theme’s function file to hide validation error tips from input fields on my forms.
I can’t seem to figure out how to hide validation error tips from check-boxes or radio fields when the user makes a choice.
If you go to the site and submit an empty form, you’ll see what I mean.
I am using the latest install of WP and CF7, plus this plugin for styling (Bettr™ CF7 Style Editor).
Any help or guidance would be very much appreciated.
Here is the script I used in the functions file:
/*
Hide text field form validation message on user click
*/function footer_script(){ ?>
<script>
jQuery(document).ready(function(){
jQuery(‘.wpcf7-form’).on(‘focus’,’.wpcf7-form-control’,function(){
if(jQuery(‘.wpcf7-not-valid-tip’,jQuery(this).parent()).length){
jQuery(‘.wpcf7-not-valid-tip’,jQuery(this).parent()).remove();
//or
//jQuery(‘.wpcf7-not-valid-tip’,jQuery(this).parent()).hide();
//or
//jQuery(‘.wpcf7-not-valid-tip’,jQuery(this).parent()).css(‘display’,’none’);
}
})
})
</script><?php }
add_action(‘wp_footer’, ‘footer_script’);
[ No bumping please. ]
The page I need help with: [log in to see the link]
The topic ‘Hide Checkbox Validation Tip on User Click’ is closed to new replies.