Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

141
Views
Ingrese la clave y el botón Enviar en el código de Google Script en la hoja

Me gustaría poder usar enter así como el botón de enviar para ejecutar/aceptar la entrada de datos y confirmar en la celda.

Parece que no puedo hacer que el código funcione. ¿Algún consejo sobre cómo modificar?

 <script> var itemBox = document.getElementById("itemname"); document.getElementById("btn").addEventListener("click",addRecord); function addRecord(){ var name = itemBox.value; if(name.trim().length == 0){ M.toast({html: "Please enter a valid barcode!"}) } else{ var data = { name:itemBox.value }; google.script.run.appendData(data); itemBox.value = ""; } } </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Por favor lea los comentarios:

 <!DOCTYPE html> <html> <head> <base target="_top"> </head> <body> <script> var itemBox = document.getElementById("itemname"); document.getElementById("btn").addEventListener("click",addRecord); function addRecord(){ var name = itemBox.value;//item box is undefined if(name.trim().length == 0){ M.toast({html: "Please enter a valid barcode!"})//M is undefined and toast does not exist clientside } else{ var data = {name:itemBox.value}; google.script.run.appendData(data); itemBox.value = ""; } } </script> </body> </html>

Spreadsheet.toast() es un método del lado del servidor de Class Spreadsheet y no está diseñado para funcionar en el lado del cliente en el navegador.

Hoja de cálculo.brindis()

Hasta ahora, la descripción de su pregunta está incompleta.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!