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

153
Views
HTML/Javascript: Capture Form Response

I'm trying to use the below snippet to capture the HTTP response of the form request and display the response in the browser. But clicking for Submit button navigates me away from my website.

<!DOCTYPE html>
<html lang="en">
   <head>
   </head>
   <body>
    <form name="responseHere" action="https://www.stackoverflow.com/">
      <input type="submit" value="Submit request" />
    </form>
      <script type="text/javascript">
            var responseHere = document.getElementById("responseHere").value;
            alert(responseHere)
      </script>
   </body>
</html>

I've also tried XHR methods to perform GET requests, but receive a CORS error when attempting to query domains outside my website's domain.

Is it possible to capture the HTTP response from the form submission and pass it to alert() or console.log() in Javascript?

about 4 years ago · Juan Pablo Isaza
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!