Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

161
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda