Why aren't I getting my form data object with input values in this submit listener?

تعرفه تبلیغات در سایت

آرشیو مطالب

امکانات وب

Vote count: 0

I have an HTML form, it's a pretty simple form, there's only 4 values that are required. It looks like this.

And here is my JavaScript

$form.addEventListener('submit', (event) => {
  event.preventDefault()

  const formData = new FormData(event.target)
   // log our form object
  console.log(formData)  
  event.target.reset()
  })

In my console log, why aren't I getting my form data object with properties and values on it that are set to the name value of my inputs as keys and values of the inputs as values? Instead I'm just getting an empty form data object.

asked 1 min ago
Gerard Degas

نویسنده : استخدام کار بازدید : 0 تاريخ : يکشنبه 5 فروردين 1397 ساعت: 5:27
برچسب‌ها :

خبرنامه

عضویت

نام کاربري :
رمز عبور :