Title: pche32's Replies | WordPress.org

---

# pche32

  [  ](https://wordpress.org/support/users/pche32/)

 *   [Profile](https://wordpress.org/support/users/pche32/)
 *   [Topics Started](https://wordpress.org/support/users/pche32/topics/)
 *   [Replies Created](https://wordpress.org/support/users/pche32/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/pche32/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/pche32/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/pche32/engagements/)
 *   [Favorites](https://wordpress.org/support/users/pche32/favorites/)

 Search replies:

## Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form 7] hook into submit (client side) before execution](https://wordpress.org/support/topic/hook-into-submit-client-side-before-execution/)
 *  Thread Starter [pche32](https://wordpress.org/support/users/pche32/)
 * (@pche32)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/hook-into-submit-client-side-before-execution/#post-14578885)
 * Erik you are GOLDEN!
    thank you very much,
 * since i fixed what you directed me to, it wasn’t even necessary change the way
   i registered javascript (so i left it using: wp_enqueue_script)
 * i’m posting code if anyone would be looking for something similar:
 *     ```
       const wpcf7Forms = document.querySelectorAll('.wpcf7');
       if (wpcf7Forms.length) {
         for (const wpcf7Form of wpcf7Forms) {
   
           const formElem = $(wpcf7Form)[0].querySelector('form');
           let formData = new FormData(formElem.formData);
   
           function getArr() {
             //your logic here
             return arr;
           }
   
           formElem.addEventListener('formdata', (e) => {
             var arr = [];
             arr = getArr();
             e.formData.append('custom-input', JSON.stringify(arr));
             formData = e.formData;
           });
   
         }
       }
       ```
   
    -  This reply was modified 4 years, 11 months ago by [pche32](https://wordpress.org/support/users/pche32/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form 7] hook into submit (client side) before execution](https://wordpress.org/support/topic/hook-into-submit-client-side-before-execution/)
 *  Thread Starter [pche32](https://wordpress.org/support/users/pche32/)
 * (@pche32)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/hook-into-submit-client-side-before-execution/#post-14577534)
 * Hi Erik,
 * thank you very much for pointing me to the right direction,
    if you don’t mind
   i would like to ask you additional/related question:
 * since i prefer not to modify plugin’s script.js itself what is ideal place to
   hook my js (script in dedicated file) itself ?
 * and so if i understand it correctly, final code should look like this:
 *     ```
       const formElem = $(wpcf7Form)[0].querySelector('form');
       let formData = new FormData(formElem.formData);
   
       formElem.addEventListener('formdata', (e) => {
           e.formData.append('custom-input-field', JSON.stringify(arr));
           formData = e.formData;
       });
       ```
   
 * thank you very much for your support and patience
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[AMP for WP - Accelerated Mobile Pages] error.js:128amp-sidebar is already registered. The script tag for amp-sidebar is](https://wordpress.org/support/topic/error-js128amp-sidebar-is-already-registered-the-script-tag-for-amp-sidebar-is/)
 *  Thread Starter [pche32](https://wordpress.org/support/users/pche32/)
 * (@pche32)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/error-js128amp-sidebar-is-already-registered-the-script-tag-for-amp-sidebar-is/#post-8887510)
 * hello [@ahmedkaludi](https://wordpress.org/support/users/ahmedkaludi/),
    because
   of this and other errors we decide to disable it for now,
 * if you need any input regarding this error i reported, just let me know (what
   kind of data and how to gather them)
 * Regards
    R

Viewing 3 replies - 1 through 3 (of 3 total)