html - Google Sites checkbox value in Google Spreadsheet -


on google sites on edit mode, have prepared checkbox using insert - html box

and within html box following code..

<style>   div{   width:100px;   height:30px;   } </style>  <script>   function putresult(e) {   var ss = spreadsheetapp.openbyid("0akkxdnrvyzqzde1yu21frgj6akj6mmzisvhtn0jmnnc");   var calc = ss.getsheetbyname("customer");    var chvalue = e.parameter.bike   calc.getrange("c3").setvalue("chvalue"); } </script>    <div>   edc:   <input type="checkbox" id="bike" onclick="putresult(e)"> </div> 

now requirements:

  1. i want true/false based on checkbox populated in ss.calc (c3) sheet.
  2. the page should automatically refreshed each time checkbox clicked.

i novice , in learning stage. please shout if things unclear.

ps:

  • i copied code within gas, that's e.parameter.bike comes from, don't know if that's right way...
  • i have inserted chart in google sites source data spreadsheet (insert chart), want make dynamic using checkboxes.


think html box not accepting onclick , not sure inspecting checkbox in firebug can see there no onclick element.
think can using google app script follows, in code.gs file,
  

function doget() {   return htmlservice.createhtmloutputfromfile('test').setsandboxmode(htmlservice.sandboxmode.native); } 

and have file called test.html.this can created file --> new --> script file, in have following code,

 <style>   div{   width:100px;   height:30px;   } </style>  <script>   function putresult() {   var ss = spreadsheetapp.openbyid("0akkxdnrvyzqzde1yu21frgj6akj6mmzisvhtn0jmnnc");   var calc = ss.getsheetbyname("customer");    var chvalue = document.getelementbyid('bike').value;   calc.getrange("c3").setvalue("chvalue"); } </script>    <div>   edc:   <input type="checkbox" id="bike" onclick="putresult()"> </div> 

i haven't tested above code.try if works you.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -