Google script web app goes blank page after submit

后端 未结 2 1475
南旧
南旧 2021-01-27 04:48

I have a google script web app with input fields. I would like all of those fields is input required if user want to submit data. Therefore, I used \"required\" attribute and ca

2条回答
  •  不知归路
    2021-01-27 05:20

    I think these two functions should be separated:

    function callEvent() {
      var cellSelectedValue = $('#cellName').val();
      google.script.run.withSuccessHandler(machineOption).machineNameByCell(cellSelectedValue);
      var machineNameDropBoxhtml = '';
    
      function machineOption(data) {
        try {
          for (var i = 0; i < data.machineNameArray.length; i++) {
            machineNameDropBoxhtml += '';
          }
          $('#machineName').html(machineNameDropBoxhtml);
          $('#machineName').formSelect();
        } catch (error) {
          alert(error);
        }
      }
    }
    

    Like this:

    function callEvent() {
      var cellSelectedValue = $('#cellName').val();
      google.script.run
      .withSuccessHandler(machineOption)
      .machineNameByCell(cellSelectedValue);
      var machineNameDropBoxhtml = '';
    }
    
    function machineOption(data) {
      try {
        for (var i = 0; i < data.machineNameArray.length; i++) {
          machineNameDropBoxhtml += '';
        }
        $('#machineName').html(machineNameDropBoxhtml);
        $('#machineName').formSelect();
      } catch (error) {
        alert(error);
      }
    }
    

提交回复
热议问题