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

160
Views
Write back values to HTML form from XMLHttpRequest

I'm working on an embedded device (ESP32) serving static pages from the internal flash (SPIFFS). I'm looking for a simple way to populate the form values with the actual values since with this approach they are loaded with the default values.

I have a working XMLHttpRequest communication channel. For example I'm able to POST the form values retrieving them with:

document.getElementById("form-controls").onsubmit = function (event) {
    event.preventDefault();
    fetch("/controls", {
        method: 'post',
        body: new FormData(document.getElementById("form-controls"))
    }).then(function(response) {
    });
}

I wondering if there's the opposite function. Using a GET method on the same url I would answer from my MCU with the actual values to be written in the form fields.

I'm able to do this manually using JSON and updating each input tag via javascript. My question is if there is an equivalent of FormData that given an input data can fill automatically the related form fields.

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!