I'm trying to capture value of my input fields and have following method in my form class to do that:
getData: function() {
var fields = ['name', 'email', 'message'];
$.each(fields, function(index, el) {
form.data[el] = $('#'+el).val();
console.log(form.data[el]);
});
},
(nevermind the 'select' field, that's a custom made select box and I'll have to handle that one differently) I perform the capture on form change event. The input fields all have proper id's, they look something like this:
<input type="text" id="name">
<input type="email" id="email">
<textarea name="message" id="message"></textarea>
Now, when I type something in the fields I only get value from the textarea, while other inputs give me undefined.
I'll also note that the form is being loaded with Ajax, but since it captures the change event on the fields normally I doubt that this is the problem.