简体   繁体   中英

Google Spreadsheet modal dialog button not responding

I have a modal dialog with a form to upload 2 files. The dialog is activated by a custom menu, and when the button is clicked, it starts a custom function.

When the HTML is simple, only with the form input areas, it works correctly.

But I want to add some instructions at the top, and when I add them, the button stops responding.

This is the code that works:

<!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>

This is the code when I add the instructions, the only difference is lines 8-10 are added:

<!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>

In your HTML, I'm worried that <p> is not enclosed. By this, I'm worried that the issue for parsing this.parentNode at Google side might occur. So, how about the following modification?

Modified 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>
  • Or, <br> might be able to be also used.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM