Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

351
Vistas
Appscript run function onClick button from html template

I'm tryng to run this function when button click from my html template.

    function sendTeacher(){
  Classroom.Invitations.create({
    "courseId": "ID",
    "userId": "E-mail",
    "role": "TEACHER"
      });

}`

I have tryed, onClick="", and others ways but seems i'm declaring the function API wrong. Could some one help me? i'm stuck on this.

<input type="button" onClick="sendTeacher()" value="Submit" /><br>`

Tryed to:

<script>
function clickBtn(){
var classEmails = document.getElementById("txt_Email").value;
var classID = document.getElementById("class").value;
document.getElementById("classEmail").innerHTML = classEmails + ": E-mail a ser inserido";
return Classroom.Invitations.create({
"courseId": classID,
"userId": classEmails,
"role": "TEACHER"
  });

};

Html file:

    <!DOCTYPE html>
<html>
  <head>
    <base target="_top">
    <?!= include('sideBarInsertStyle') ?>
    <?!= include('sideBarInsertSelect') ?>
  </head>
    <body>

        <input type="button" onClick="sendTeacher()" value="Submit" /><br>

  </body>
</html>
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Try to use "onclick" instead of "onClick"

according to w3shcool https://www.w3schools.com/jsref/event_onclick.asp it using lowercase not camel case

if the script are sparated file i suggest to use addeventlistener instead

about 4 years ago · Juan Pablo Isaza Denunciar

0

Try it this way:

<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
    <?!= include('sideBarInsertStyle') ?>
    <?!= include('sideBarInsertSelect') ?>
  </head>
    <body>
        <input type="button" onclick="google.script.run.sendTeacher();" value="Submit" />
  </body>
</html>

Either onclick or onClick will work

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda