简体   繁体   中英

Posting A Form To An External URL From A Google Site

I've created an external HTML form to be hosted on a site outside of a main site that is coded in Rails. I've tested this using http://htmledit.squarefree.com/ (jsfiddle didn't post to the server) and it works.

However, the client wants to put the form on a Google Sites page. I've added it as a HTML box, but when I submit the form the server doesn't see a peep.

The form code is:

<form action="http://thesite.com/signup_ext" method="post">
  <input type="text" name="first_name" />
  <input type="text" name="last_name" />
  <input type="text" name="email" />
  <input type="submit" name="commit" value="Sign Up" />
</form>

Is this possible to do on Google Sites?

You may need to create a Google Apps Script file, and make it a Stand Alone Web App. A Stand Alone Web App is basically a website that you can't map a domain name to. Put the form into the Web App, then put the Apps Script into an Apps Script Gadget in the Google Site.

Guide to HTML Service

You will need to use the client side API to send form data to the Apps Script .gs function.

Google Documentation - google.script.run

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM