Title: Form without submit button
Last modified: January 7, 2020

---

# Form without submit button

 *  Resolved [omusman](https://wordpress.org/support/users/omusman/)
 * (@omusman)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/form-without-submit-button/)
 * I want a button above Go to top button, where i found this: [GP-Forms](https://generatepress.com/forums/topic/social-media-instagram-link-scroll-button-similar-to-gp-back-to-top-button/#post-530149)
 * But as my button is a form input it shows while the users didn’t scroll download
   which I think is because of this tag <button></button>
 * and here’s where I want to submit a form without a button.
 * Trying to achieve:
 * Article: [https://stackoverflow.com/questions/7704976/submit-a-html-form-without-having-a-submit-button](https://stackoverflow.com/questions/7704976/submit-a-html-form-without-having-a-submit-button)
 * `<scirpt>document.getElementById("myForm").submit();</scirpt>`
 *     ```
       <form action="google.com" method="post" target="_blank">
       <div id="myForm">Google</div>
       </form>
       ```
   
 * Used GP-Elements to execute the code but throwing this error:
 * `Cannot read property 'submit' of null`
    -  This topic was modified 6 years, 4 months ago by [omusman](https://wordpress.org/support/users/omusman/).
    -  This topic was modified 6 years, 4 months ago by [omusman](https://wordpress.org/support/users/omusman/).

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

 *  Theme Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/form-without-submit-button/#post-12302524)
 * Hi there,
 * `Cannot read property 'submit' of null`
 * That error means there isn’t an element on the page with `myForm` as the ID. 
   Can you confirm that it exists?
 *  Thread Starter [omusman](https://wordpress.org/support/users/omusman/)
 * (@omusman)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/form-without-submit-button/#post-12303139)
 * Was adding id=”myForm” on div tag rather than form elemet:
 * Wrong:
 *     ```
       <form action="google.com" method="post" target="_blank">
       <div id="myForm">Google</div>
       </form>
       ```
   
 * Right:
 *     ```
       <form id="myForm" action="google.com" method="post" target="_blank">
       <div>Google</div>
       </form>
       ```
   
 * Thank You Tom 🙂
 *  Theme Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/form-without-submit-button/#post-12305361)
 * Glad you got it working 🙂

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

The topic ‘Form without submit button’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/generatepress/3.6.1/screenshot.
   png)
 * GeneratePress
 * [Support Threads](https://wordpress.org/support/theme/generatepress/)
 * [Active Topics](https://wordpress.org/support/theme/generatepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/generatepress/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/generatepress/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tom](https://wordpress.org/support/users/edge22/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/form-without-submit-button/#post-12305361)
 * Status: resolved