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

96
Views
How to make sure a webpage user's post request is processed successfully on the server side before the client can go to the next page in Node JS?

I am using javascript and Node JS to build a website to collect data for my writing research. The website is designed with a series of webpages with each page housing a different typing or writing task. Participants need to complete a task on one page, click the submit button to post the data to the server side, and click next to move on to the next page until they reach the last page of the study. For your information, here is the website I created: https://writingresearch.herokuapp.com.
However, here comes one issue: in some cases, when the internet connection on the client side is weak or unstable, it might take some time (say, more than 2 seconds) for the data to reach the server side for processing. In other words, the participant of the study may go to the next page before their posted data are successfully processed on the server side. If this happens, the server side ends up losing the data. Thus, I am wondering if there is a method to enable the communication between the server side and the client side so that the user of the website cannot go to the next page until their post request is successfully processed. Does anyone know how to do this in Node JS? I hope I have explained my question clearly. Thanks for your time and attention. I really appreciate your help!!!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

On pressing the submit button, you should do the following:

  1. Disable the "Submit" button so that user doesn't send another POST request again by clicking on submit button again. Show a loader somewhere so that user could know that answer is being submitted.

  2. Disable the "Next" button until you receive a successful response from server.

  3. On receiving successful response from server, enable both buttons and show a notification (such as an alert box) informing that the answer is submitted successfully.

  4. If you receive error from server, then also show the error in the notification (or in the alert box) and enable both buttons.

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!