Manipulating Forms in Google Spreadsheets

Google Docs has a useful (and brilliantly implemented) feature that generates an HTML form for people to fill in, with the results saved as a row in the spreadsheet.

If you create a new spreadsheet, switch to the 'Form' tab and click 'Create a form', you can add questions in a variety of different forms (text, multiple choice, checkbox, etc). Once the form is saved, you can visit the live form, where you'll notice that it's just a standard HTML form: there are no form tokens or anything preventing you from altering the appearance of the form or even submitting the values directly from a server-side script.

One possibility is to use MaxMind's free GeoLite City database and API libraries to convert a visitor's IP address to a lat/long pair, address and country code, prefill this in the form as hidden fields, then use Google's map visualisation widget to display the results on a map.

Examples:

Comments

Can I create multiple forms for the same survey. (Say I have 100 questions and I want to put 10 questions per form.

Posted by: Anonymous on September 2, 2008 11:10 PM

I'm not sure, you might have to use the Google Data API to do that, otherwise you'll probably get a new row for each form submission. You could always break the form up into separate parts using Javascript though.

All fields are optional, email address will not be shown; no HTML, URLs are automatically hyperlinked.