Код: Выделить всё
Headset?:
< /code>
Это мой javascript, вызывая различные функции Google Script. Бит, который использует флажок, находится в нижней части, < /p>
$(function() {
// Assign handler functions to sidebar elements here, if needed.
$('#GetSerial-button').click(onGetSerialClick);
$('#Submit-button').click(onSubmitClick);
});
function onGetSerialClick() {
this.disabled = true;
google.script.run
.withSuccessHandler(
function(msg, element) {
$('#Serial-value').val(msg);
showStatus('Pulled Serial Successfully.');
element.disabled = false;
})
.withUserObject(this)
.getSerialValue();
}
function onSubmitClick() {
this.disabled = true;
var serial = $('#Serial-value').val();
var warrantyNotes = $('#warrantyNotes-value').val();
var warrantyRepair = $('#Warranty-Repair').val();
var headsetCheck = $('#headset-Check').val();
google.script.run
.withSuccessHandler(
function(msg, element) {
showStatus('Submitted ');
element.disabled = false;
})
.withUserObject(this)
.setHeadsetValues(warrantyRepair,headsetCheck,warrantyNotes,serial)
google.script.run
.addNewRow();
}
function showStatus(msg, classId) {
$('#sidebar-status').removeClass().html(msg);
if (classId) {
$('#sidebar-status').addClass(classId);
}
}
< /code>
У меня есть функция GS, чтобы помещать переменные в правильный лист.var headsetCheck = $('#headset-Check').is(':checked');
Подробнее здесь: https://stackoverflow.com/questions/315 ... ml-service