簡體   English   中英

Google 電子表格模式對話框按鈕沒有響應

[英]Google Spreadsheet modal dialog button not responding

我有一個帶有表單的模式對話框,用於上傳 2 個文件。 該對話框由自定義菜單激活,單擊按鈕時,它會啟動自定義 function。

當 HTML 很簡單時,只有表單輸入區域,它才能正常工作。

但是我想在頂部添加一些說明,當我添加它們時,按鈕停止響應。

這是有效的代碼:

<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
    <link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css">
  </head>
  <form style="font-size:16px">
    Excel MercadoLibre &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="file" name="fileML">
    <br>
    <br>
    Excel Contabilium &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="file" name="fileContabilium">
    <br><br><br>
     <input type="button" value="Importar" class="action " style="font-size:16px" style="height: 150px;" style="text-align:center;" 
        onclick="google.script.run
            .withSuccessHandler(google.script.host.close)
            .uploadFile(this.parentNode)" />
    </form>
</html>

這是我添加指令時的代碼,唯一的區別是添加了第 8-10 行:

<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
    <link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css">
  </head>
  <form style="font-size:16px">
    1) En el <a href="https://www.mercadolibre.com.ar/ventas/listado" target="_blank">listado de ventas de ML</a>, filtrar por el período a procesar, y descargar el excel de ventas.<p>
    2) En el <a href="https://app.contabilium.com/modulos/ventas/integraciones.aspx?" target="_blank">listado de ventas de Contabilium</a>, filtrar por el período a procesar, y exportar el excel simple.<p>
    3) Subir ambos archivos:<p>
    Excel MercadoLibre &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="file" name="fileML">
    <br>
    <br>
    Excel Contabilium &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="file" name="fileContabilium">
    <br><br><br>
     <input type="button" value="Importar" class="action " style="font-size:16px" style="height: 150px;" style="text-align:center;" 
        onclick="google.script.run
            .withSuccessHandler(google.script.host.close)
            .uploadFile(this.parentNode)" />
    </form>
</html>

在您的 HTML 中,我擔心沒有包含<p> 至此,我擔心谷歌端解析this.parentNode可能會出現問題。 那么,下面的修改呢?

修改后的 HTML:

<!DOCTYPE html>
<html>
<head>
  <base target="_top">
  <link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css">
</head>
<form style="font-size:16px">
  <p>1) En el <a href="https://www.mercadolibre.com.ar/ventas/listado" target="_blank">listado de ventas de ML</a>, filtrar por el período a procesar, y descargar el excel de ventas.</p>
  <p>2) En el <a href="https://app.contabilium.com/modulos/ventas/integraciones.aspx?" target="_blank">listado de ventas de Contabilium</a>, filtrar por el período a procesar, y exportar el excel simple.</p>
  <p>3) Subir ambos archivos:</p>
  Excel MercadoLibre &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <input type="file" name="fileML">
  <br>
  <br>
    Excel Contabilium &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <input type="file" name="fileContabilium">
  <br><br><br>
  <input type="button" value="Importar" class="action " style="font-size:16px" style="height: 150px;" style="text-align:center;"
        onclick="google.script.run
            .withSuccessHandler(google.script.host.close)
            .uploadFile(this.parentNode)" />
</form>
</html>
  • 或者, <br>也可以使用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM