I am trying to write a container-bound project for a Google Sheet. It would allow me to search for a matching value in one column, and depending on the response, dictate that the record is full, allow me to fill in the missing values, or, if the value is not there at all, write a new row.
The actual HTML isn't an issue, and thanks to Stackdriver Logger, I know that the initial form values are being passed correctly, including setting a value as cache, which is used to decide what is the second HTML form for the sidebar. The thing is that, when I submit either of the second forms, the function I'm attempting to call to add the values to the table are not initializing, even though the script should be the same.
For reference, this is the the contents of the <script> tags in the initial HTML file:
document.querySelector("#cunyID").addEventListener("submit",
function(e) {
e.preventDefault();
google.script.run.cunyIDQuery(this);
google.script.run.newSidebar();
}
);
This is the contents of <script> in one of the second forms:
gpa.onchange = function setTwoNumberDecimal(event) {
this.value = parseFloat(this.value).toFixed(2);
};
q1.onchange = function setWholeNumber(event) {
this.value = parseFloat(this.value).toFixed(0);
};
q2.onchange = function setWholeNumber(event) {
this.value = parseFloat(this.value).toFixed(0);
};
q3.onchange = function setWholeNumber(event) {
this.value = parseFloat(this.value).toFixed(0);
};
document.querySelector("#noCUNYID").addEventListener("submit",
function(e) {
e.preventDefault();
google.script.run.noCUNYIDSubmit(this);
google.script.host.close();
}
);
And this is from the second of the second-level forms:
q1.onchange = function setWholeNumber(event) {
this.value = parseFloat(this.value).toFixed(0);
};
q2.onchange = function setWholeNumber(event) {
this.value = parseFloat(this.value).toFixed(0);
};
q3.onchange = function setWholeNumber(event) {
this.value = parseFloat(this.value).toFixed(0);
};
document.querySelector("#yesCUNYID").addEventListener("submit",
function(e) {
e.preventDefault();
google.script.run.yesCUNYIDSubmit(this);
google.script.host.close();
}
);
Even though, theoretically, google.script.run should be calling for the functions, Stackdriver is not reporting the function opening, and google.script.host.close() is running correctly. Does anyone know what might be going on?