Support » Plugin: Contact Form 7 » [Plugin: Contact Form 7] make field required using checkbox

  • shuvra124


    is there any way that i can make text field required when checkbox checked and make it non required when checkbox unchecked? i think it can be done by jQuery but i can’t find any way to do it 🙁 if any1 have idea plz help me. i try like this

    jQuery("#addReq span input").click(function() {
    	if(jQuery(this).is(":checked")) {
    		jQuery(".your-address input").addClass("wpcf7-validates-as-required");
    		jQuery(".your-address input").attr("title", "Address*");
    	else {
    		jQuery(".your-address input").removeClass("wpcf7-validates-as-required");
    		jQuery(".your-address input").attr("title", "Address");

  • The topic ‘[Plugin: Contact Form 7] make field required using checkbox’ is closed to new replies.