I am (still) working on creating sidebar input for a Sheets add-on I'm developing. My current challenge is allowing a textbox and a checkbox to be passed from the form to my function.
The textbox works and successfully passes the variable. The checkbox I'm not as clear on. I need to turn the checkbox into a boolean.
The relevant html:
<p>
<input type="text" id="datepicker">
</p>
<p>
Include pledge?<br>
<input type="checkbox" name="pledge[]" id="pledgeCheck" value="true">Yes<br>
<input type="radio" name="pledge" id="Off">No
</p>
<p>
<input type="button" name="createdate" value="Create" onClick="google.script.run.create(document.getElementById('datepicker').value,document.getElementById('pledgeCheck').value)" />
</p>
function create(datepicker,pledge) {
//important vars
var responses = ss.getSheetByName("Form Responses");
var bulletin = ss.getSheetByName(todayDate);
var todayDate=datepicker;
var pledgeCheck=pledge;
Logger.log(pledgeCheck);
currently the pledge feeds back as undefined.
Aucun commentaire:
Enregistrer un commentaire