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

230
Views
FormData no cargará entradas de formulario

Mi código

 <!DOCTYPE html> <html> <body> <div id="form-sample"> <form enctype="multipart/form-data"> <input type="text" name="sample-text" /> <input type="radio" name="sample-radio" value="yes" /> <input type="radio" name="sample-radio" value="no" /> <input type="file" name="images[]" multiple="multiple" /> <input type="submit" value="Fetch Data" /> </form> </div> <script> function onSubmitForm(e) { e.preventDefault(); const fD = new FormData(document.querySelector("#form-sample form")); console.log(fD.entries()); // get an empty FormData Iterator } document.addEventListener('DOMContentLoaded', function(e) { document.querySelector("#form-sample form").addEventListener("submit", onSubmitForm, false); }); </script> </body> </html>

¿Por qué FormData no carga las entradas de <form> y por qué no devuelve una excepción?

En realidad, estoy probando este código en la última versión de Firefox (v95.0)

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

0

  1. Puede iterar a través del iterador: https://developer.mozilla.org/en-US/docs/Web/API/FormData/entries

  2. Puede obtener los valores uno por uno: https://developer.mozilla.org/en-US/docs/Web/API/FormData/get

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!