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

187
Vistas
undefined function onclick event

I'm trying to create a website that would get the user input, selected options and email those inputted information to the user's email. My problem here is the onClick event doesn't work properly, it does nothing and shows that the function is not defined.

        Name:<br><input type="text" id="name" required/> <br/>

                <label><br>Example</label> 
                <br>
                    <select name="choice">
                    <option value="" selected>--SELECT--</option>
                    <option value="choice1">choice1</option>
                    <option value="choice2">choice2</option>
                    
                   </select><br>
   
                <button type='submit' onclick='myFunction()'>SUBMIT</button>
        

The function that would supposedly get the data from user input upon clicking submit.

function myFunction(){

  var name = $("#name");
  var email = $("#email");
  var schedule = $("#schedule");
  var time = $("#time"); 


  if(isNotEmpty(name) && isNotEmpty(email) && isNotEmpty(time) && isNotEmpty(schedule)) {
     $.ajax({
        url: 'send.php',
        method: 'POST',
        dataType: 'json',
        data:{
           name: name.val(),
           email: email.val(),
           schedule: schedule.val(),
           time: time.val() 
        }, success: function(response){
           $("#status")[0].reset();
           $('.status').text("Kindly check your email for status of Delivery. Thank you!");
        }
     });
  }
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Add jquery file to header. I think it's after the jquery code.

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