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

114
Vistas
possible to have the result of a js button but it make it not refresh

i have php script to listen to a button that executes each second but i cant get the result of it because it keeps refreshing which i do not want my code for the button is below and the js timer, its simple code.

<form id="trigger">
  <input type="submit" id="trigger" name="trigger" onclick="e()" value="click">
</form>

and this is the timer plus click;

<script>

  
  setTimeout(function () {

    document.getElementById("trigger").submit();
}, 1000);
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Just don't do

document.getElementById("trigger").submit();

To get the value from some input box use:

document.getElementById('textbox_id').value;

and then you could pass the value on to your script using ajax.

If you want to emulate click use:

document.getElementById('trigger').click();

Your onclick function e() should return false to disable the submit process which will refresh the page. Also, you should not use the same identifier for multiple things (you from and button are both "trigger").

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