Paulo Dos Santos Paulo Dos Santos - 1 year ago 170
HTML Question

How to use Google Forms without iframe?

Some years ago, I found on internet how to use Google forms inside a contact page only using a query in the attribute submit button action without iframe. Now, I can't find it anymore. Is it still possible to use Google forms without iframe?

Answer Source

I just found it!

 function postToGoogle() {
   var field1 = $("input[type='radio'][name='qs1']:checked").val();
   var field2 = $('#feed').val();

     url: "",
     data: {
       "entry.924752166": field1,
       "entry.997497831": field2
     type: "POST",
     dataType: "xml",
     statusCode: {
       0: function() {
         //Success message
       200: function() {
         //Success Message

/* $(document).ready(function() {
   $('#form').submit(function() {
     return false;
<script src=""></script>

<strong>Test Google Form</strong>
<form id="form" target="_self" onsubmit="" action="javascript: postToGoogle()">
    <label>Question 1</label>
    <input id="qs1_op_1" type="radio" value="Yes" name="qs1" />
    <input id="qs1_op_2" type="radio" value="No" name="qs1" />

    <textarea id="feed" name="feed"></textarea>
  <div style="width: 100%; display: block; float: right;">
    <button id="send" type="submit">
<br /><br />
The <a href="">Result</a> takes few minutes to be shown, but it is sent to the google sheet instantaneously. 
<br /><br />

It's working in CodePen.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download