I am attempting to develop a bookmarklet that analyzes a webpage and transmits the extracted information to a Google Sheets document using a preset form. Below is the relevant section of my script:
var submissionForm = document.createElement('form');
submissionForm.action = 'http://spreadsheets.google.com/formResponse?formkey=Fd0SHgwQ3YwSFd5UHZpM1QxMlNOdlE6MA&ifq';
submissionForm.method = 'POST';
submissionForm.id = 'spreadsheet-form';
submissionForm.innerHTML = [
'<input id="entry_1" name="entry.1.single" value="' + orderTimestamp + '"/>',
'<input name="entry.2.single" value="' + userEmail + '"/>',
'<input name="entry.3.single" value="' + userID + '"/>'
].join('');
submissionForm.submit();
alert(submissionForm.innerHTML);
I am not seeing any data being recorded through the bookmarklet, so I wonder if there’s a way to capture the response from Google within my bookmarklet’s logic (note: I have integrated jQuery using jQueryify).
Update:
The Firebug Net panel isn’t detecting any activities initiated by my bookmarklet. Should I consider using Google’s viewform instead of formresponse for my approach?
The form I am trying to use can be accessed at:
http://spreadsheets.google.com/viewform?hl=en&formkey=dFd0SHgwQ3YwSFd5UHZpM1QxMlNOdlE6MA
What steps can I take to programmatically input my script data into this form and submit it through the bookmarklet while parsing the current page?