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

104
Views
Can't get values from datalist in js

I am trying to get values out of a datalist form but it seems that there's a bug in my script for my 'input#date' and my 'input#idPosition'

Console says :

{person: 'Etudiant', idPosition: input#idPosition, fact: 'Harcèlement', loc: "Dans l'établissement", date: input#date, …} anon: "Oui" date: input#date fact: "Harcèlement" idPosition: input#idPosition loc: "Dans l'établissement" msg: null person: "Etudiant" [[Prototype]]: Object

Could you help ?


there is no error report, only i can't get the value out of this input cause it shows 'date: input#date' instead of the value inside it ..

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

0

nope, those are the right ones const stalkingForm = document.querySelector('#stalkingForm');

stalkingForm.addEventListener('submit', addForm);

function addForm(e) {
    e.preventDefault();
    const formData = new FormData(stalkingForm);
    const person = formData.get('person');
    const position = formData.get('idPosition');
    const fact = formData.get('fact');
    const loc = formData.get('loc');
    const name = formData.get('date');
    const msg = formData.get('msg');
    const anon = formData.get('anon');
    console.log('form', {person, idPosition, fact, loc, date, msg, anon});
    e.return 
}
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!