Title: Bug with invalidation
Last modified: November 28, 2023

---

# Bug with invalidation

 *  [robwebfx](https://wordpress.org/support/users/robwebfx/)
 * (@robwebfx)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/bug-with-invalidation/)
 * Hey!
 * We have a form with a required signature field (e.g. [signature*]). We noticed
   that if we submitted the form without a value, the field would not appear as 
   invalid.
 * CF7 applies the wpcf7-not-valid HTML class and “Please fill out this field” tooltip
   by targeting the .wpcf7-form-control-wrap elements that contain the inputs. However,
   CF7 targets these elements through their data-name props, which isn’t currently
   being added: [https://rob.webpagefxdev.com/snaps/1701189015](https://rob.webpagefxdev.com/snaps/1701189015)(
   file: main/backend/digital-signature-backend-cf7.php).
 * Could this be updated to the following?
 *     ```wp-block-code
       <?php
   
       $html = sprintf(
       '<div class="dscf7_signature">
         <div class="dscf7_signature_inner">
           <canvas id="digital_signature-pad_%1$s" name="%1$s" class="digital_signature-pad" %4$s></canvas>
           <input class="clearButton" type="button" value="+">
         </div>
         <span class="wpcf7-form-control-wrap %1$s" data-name="%7$s">
           <input %2$s />
           <input %5$s class="wpcf7_input_%1$s_attachment" />
           <input %6$s class="wpcf7_input_%1$s_inline" />%3$s
         </span>
       </div>',sanitize_html_class($tag->name) , $atts, $validation_error ,$attsa ,$atts_attach,$atts_inline, esc_attr( $tag->name ) );
       return $html;
       ```
   
 * This should then work with CF7’s invalidation functionality! (example: [https://rob.webpagefxdev.com/snaps/1701189232](https://rob.webpagefxdev.com/snaps/1701189232))

The topic ‘Bug with invalidation’ is closed to new replies.

 * ![](https://ps.w.org/digital-signature-for-contact-form-7/assets/icon-256x256.
   png?rev=2721251)
 * [Digital Signature For Contact Form 7](https://wordpress.org/plugins/digital-signature-for-contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/digital-signature-for-contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/digital-signature-for-contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/digital-signature-for-contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/digital-signature-for-contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/digital-signature-for-contact-form-7/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [robwebfx](https://wordpress.org/support/users/robwebfx/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/bug-with-invalidation/)
 * Status: not resolved