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

121
Views
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 answers
Answer question

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