• Resolved sergio.pinna.prato

    (@sergiopinnaprato)


    Hi,

    if i click to “Sand a message” the messagge error doesn’t output in the label plugin, or near an icon plugin.

    If you see in your demo page you can taht the error messages are in:
    – Your Name (required)
    – Your Email (required)
    – Subject
    – Your Message

    but there isn’t near at the icons plugin.

    In my opinion is better add the error messagge also near icon plugin.

    https://wordpress.org/plugins/contact-form-7-image-captcha/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter sergio.pinna.prato

    (@sergiopinnaprato)

    I try to change your code from:

    <div class="captcha-image">
    
        <p><?php _e('Please prove you are human by selecting the', 'cf7-image-captcha'); ?> <span><?php echo $choice[$human]; ?></span> <?php _e('.', 'cf7-image-captcha'); ?></p>
    
        <?php
        $i = -1;
        foreach($choices as $title => $image) {
            $i++;
            if($i == $human) { $value = "kc_human"; } else { $value = "bot"; };
            echo  '<label><input type="radio" name="kc_captcha" value="'. $value .'"/><i class="fa '. $image .'"></i></label>';
        }
        ?>
    
        <!--label><input type="radio" name="captcha" value="human" /><i class="fa fa-heart"></i></label> <label><input type="radio" name="captcha" value="bot"  /><i class="fa fa-home"></i></label> <label><input type="radio" name="captcha" value="bot" /><i class="fa fa-star"></i></label-->
    </div>

    to

    <div id="captcha" class="captcha-image">
    
        <p><?php _e('Please prove you are human by selecting the', 'cf7-image-captcha'); ?> <span><?php echo $choice[$human]; ?></span> <?php _e('.', 'cf7-image-captcha'); ?></p>
    
        <span class="wpcf7-form-control-wrap checkbox kc_captcha">
    
            <span clas="wpcf7-form-control wpcf7-checkbox wpcf7-validates-as-required">
    
                <?php
                $i = -1;
                foreach($choices as $title => $image) {
                    $i++;
                    if($i == $human) { $value = "kc_human"; } else { $value = "bot"; };
                    echo '<span class="wpcf7-list-item"><label><input type="radio" name="kc_captcha" value="'. $value .'"><i class="fa '. $image .' wpcf7-list-item-label"></i></label></span>';
                }
                ?>
    
            </span>
    
        </span>
    
        <!--label><input type="radio" name="captcha" value="human" /><i class="fa fa-heart"></i></label> <label><input type="radio" name="captcha" value="bot"  /><i class="fa fa-home"></i></label> <label><input type="radio" name="captcha" value="bot" /><i class="fa fa-star"></i></label-->
    </div>

    but CF7 doesn’t show the error messagge…
    …something in my code is wrgon, …sorry 😛

    But I hope help you! 🙂

    Thread Starter sergio.pinna.prato

    (@sergiopinnaprato)

    Ok,

    I DID IT! 😀

    I changed your code from:

    <div class="captcha-image">
    
        <p><?php _e('Please prove you are human by selecting the', 'cf7-image-captcha'); ?> <span><?php echo $choice[$human]; ?></span> <?php _e('.', 'cf7-image-captcha'); ?></p>
    
        <?php
        $i = -1;
        foreach($choices as $title => $image) {
            $i++;
            if($i == $human) { $value = "kc_human"; } else { $value = "bot"; };
            echo  '<label><input type="radio" name="kc_captcha" value="'. $value .'"/><i class="fa '. $image .'"></i></label>';
        }
        ?>
    
        <!--label><input type="radio" name="captcha" value="human" /><i class="fa fa-heart"></i></label> <label><input type="radio" name="captcha" value="bot"  /><i class="fa fa-home"></i></label> <label><input type="radio" name="captcha" value="bot" /><i class="fa fa-star"></i></label-->
    </div>

    to

    <div class="captcha-image">
    
        <p><?php _e('Please prove you are human by selecting the', 'cf7-image-captcha'); ?> <span><?php echo $choice[$human]; ?></span> <?php _e('.', 'cf7-image-captcha'); ?></p>
    
        <?php
        $i = -1;
        foreach($choices as $title => $image) {
            $i++;
            if($i == $human) { $value = "kc_human"; } else { $value = "bot"; };
            echo  '<label><input type="radio" name="kc_captcha" value="'. $value .'"/><i class="fa '. $image .'"></i></label>';
        }
        if($_POST['cf7ic_exists']) {
        	if(!empty($_POST['kc_honeypot']) || $_POST['required'] != "kc_human") {
        		printf('<span class="wpcf7-not-valid-tip" role="alert">__('HERE YOUR ERROR MESSAGGE');</span>');
        	}
        }
        ?>
    
        <!--label><input type="radio" name="captcha" value="human" /><i class="fa fa-heart"></i></label> <label><input type="radio" name="captcha" value="bot"  /><i class="fa fa-home"></i></label> <label><input type="radio" name="captcha" value="bot" /><i class="fa fa-star"></i></label-->
    </div>

    Thank you for your contribution, I’ll work on getting the validation notification to work correctly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Where is the error messagge near icon plugin?’ is closed to new replies.