I've just made such a thing. Here's a break down of my process.
I need to keep a list of quotes from different web pages, and to add some info to each quote.
My bookmarklet will dynamically generate a google form (I've just viewed the source of the real google form that I've already created), it'll automatically fill the current url, the page title, and the currently selected text, than, the form will be submitted.
Since I need to manually add info, I intentionally didn't include at least one required field, so I receive the google form with an error message (but with url, title & quote already filled). Now I can manually add all the other info that I need and submit the form.
If the bookmarklet fill all the required fields you'll just receive the google form success response "Thanks! Your response has been recorded."
I've used the following site to generate a bookmarklet that use jQuery:
http://benalman.com/code/test/jquery-run-code-bookmarklet/
(I'm using jQuery to be able to scrap additional info & content from the webpage)
To be able to use that site properly, you'll have to escape your one-liner html (you can use this escape tool)
The required steps are:
- Create a google form / spreadsheets
- View the source of the form and copy the fields you want the bookmarklet to fill
- Escape your html and use this to write your script that fill the info, this site will create the bookmarklet for you
So in my case:
1. I've created a form that include one text field to hold the url, another text field to hold the title of the page, a paragraph text to hold the quote (the selected text). The form also include some other required fields that I fill manually.
2. I prepared the following html:
<form method="POST"
action="https://spreadsheets.google.com/spreadsheet/formResponse?formkey=XYZXYZXYZXYZXYZXYZXYZ&ifq">
<input type="text" name="entry.0.single" value="" id="entry_0" />
<input type="text" name="entry.3.single" value="" id="entry_3" />
<textarea name="entry.2.single" id="entry_2"></textarea>
<input type="submit" name="submit" value="submit" />
</form>
(entry_0 - url, entry_3 - page title, entry_2 - quote)
3. After putting it in one line and escaping it. I've used the following script:
frm = $(unescape('%3Cform%20action%3D%22https%3A//spreadsheets.google.com/spreadsheet/formResponse%3Fformkey%3DXYZXYZXYZXYZXYZXYZXYZ%26amp%3Bifq%22%20method%3D%22POST%22%3E%0A%3Cinput%20type%3D%22text%22%20name%3D%22entry.0.single%22%20value%3D%22%22%20id%3D%22entry_0%22%20/%3E%0A%3Cinput%20type%3D%22text%22%20name%3D%22entry.3.single%22%20value%3D%22%22%20id%3D%22entry_3%22%20/%3E%0A%3Ctextarea%20name%3D%22entry.2.single%22%20id%3D%22entry_2%22%3E%3C/textarea%3E%0A%3Cinput%20type%3D%22submit%22%20name%3D%22submit%22%20value%3D%22submit%22%20/%3E%0A%3C/form%3E'));
$(frm).children('#entry_0').attr('value',location.href);
$(frm).children('#entry_3').attr('value',$('title')[0].innerHTML);
$(frm).children('#entry_2').html(window.getSelection().toString());
$(frm).children('input[type=submit]').click()
This method has been tested with chrome.
Good luck!