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

138
Views
Pasar de un CSV en el servidor local para completar un menú desplegable

Absolutamente nuevo en JS. Quiero tomar un csv almacenado en el host local y luego usar el contenido para completar una lista desplegable. Tengo:

 <form id="database" name="database" onsubmit="return validateForm()" method="POST" action="" enctype="multipart/form-data"> <label>Customer:</label> <select id="custnum" name="custnum"> </select>

Luego iba a poner el contenido del csv en el menú desplegable usando:

 <script> $.get( "/data/test1.csv", function(CSVdata) { data = new Array ($.csv.toArray(CSVdata)); console.log(data)}); ##using this to view if I even had it in the array list </script>

Pero esto arroja: TypeError: no se pueden leer las propiedades de undefined (leyendo 'toArray')

Cada vez que esto iba a empezar a funcionar, iba a hacer:

 var dropdown = $('custnum'); for(var i = 0; i < data.length; i++) { var record = data[i]; var entry = $('<option>').attr('value', record.someProperty); dropdown.append(entry); }
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!