To post data from Google Spreadsheet, initially make the spreadsheet and change the sheet name to DATA. After that, open the script editor in your sheet and insert the script. Alter "doGet(e)" to "doPost(e)". Run the setUp script two times. For the first time, it will ask for authority to run (allow it), then the second time you choose to run it you would not get any popup suggestion it has run. After that, choose Publish in the script editor, and then choose Publish as Service. Click the allow anybody to raise this service radio button and allow unidentified access check box. Copy the URL and click the Enable Service. This was the trickier part.
In your HTML form, every element that you are putting forward must have a name attribute. This name is how the data is delivered - each entry is fixed to its name. Ensure that for every portion of form data you are gathering, it has a name, and that name is gone through as a column on your spreadsheet. For your form, fix the method to post and the action to your Publish as Service URL such as: <form id="formID" method="post" action="URL" target="hidden_iframe"> <iframe name="hidden_iframe" id="hidden_iframe" style="display:none;"></iframe> Fix some type of form validation (not required, but if every field is not filled out you will get partial data in your spreadsheet), and if it is authenticated have it call a jquery .submit(). e.g.: if (formValidation === true){ $("#formID").submit(); } else {}
0 Comments
Leave a Reply. |
AuthorI am a content writer by profession. Like to write about technologies. Currently, I am focusing on Bulk SMS Services. How penetration of bulk SMS in businesses changed the way of maketing. Archives
November 2016
Categories |