I'm using this
var data = $(":input,:submit", this).serializeArray(); To try and capture form data and it does work for the two specified elements.
How do I expand this so I can get the selected entries from textarea, multiselect dropdown lists and file upload fields ?
I've tried :
var data = $(":input,:submit,:file", this).serializeArray(); But nothing was returned for the file, I was hoping for the file name.
The same code is being called on multiple pages, some with file or textarea others without. The forms on each page all have different Id's so I'm using :
$(this).on('submit', function(e) { var data = $(":input,:submit", this).serializeArray(); } Any idea how I can get this to work ?
Thanks
Data from file select elements is not serialized.You have to push it manually but be aware of security reason regarding fake path