I have a form that I have created using Google App Script. And it is really good because it allows me to create a form that could be moulded in any manner and not be put down by the limitation of Google Forms. But I am now having a hard time figuring out how to run a script to manipulate the innerHTML of a div using form action when the form in submitted. Can someone help me with this or suggest a solution.
1 Answer
This should be standard JavaScript. The nice thing about HtmlService is that anything you can do in jQuery, you should be able to do in JavaScript. Some restrictions apply because we need to apply Caja to sandbox the JavaScript so it is safe, but this should not interfere with what you are doing.
What you want to do is this:
Attach an onClick handler to the submit button. Return false from this function so it does not do an HTTP POST/GET.
In the onClick function, use the jQuery function to find the div element you want to populate and populate it with data.
I highly recommend John Resig's jQuery tutorial if you haven't done it already.