I have a spreadsheet that tracks when students "cash in" prizes they've won. I wrote a script that checks to see if the neighboring checkbox is checked and should print the month and day when it was checked.
function installableonEdit(e) {
var s = SpreadsheetApp.getActiveSheet(); //gets active spreadsheet
if (s.getName() == 'Main') { //determines whether the active spreadsheet is the 'Main' or not
var value = (typeof e.value == "object" ? e.range.getValue() : e.value);
if (e.range.columnStart == 3 && value == "TRUE" || e.range.columnStart == 8 && value == "TRUE" || e.range.columnStart == 13 && value == "TRUE" || e.range.columnStart == 18 && value == "TRUE" || e.range.columnStart == 23 && value == "TRUE") {
e.range.offset(0, 1).setValue(new Date()).setNumberFormat("mm/dd"); //checks to see if 'out' checkboxes have been ticked, if yes, inputs current time in next column over
}
}
}
I installed a trigger to make it work when it is edited but nothing prints in the cell when I click a textbox. What am I doing wrong?
Here's a link to my spreadsheet
https://docs.google.com/spreadsheets/d/1IW28Aho5oYbrrLKmyAWiq-vYTSLq-JXIerfDAzR3gCI/edit?usp=sharing