I want to change profile information. There are 4 input box and 2 input file type.
i can't passing input box value and input file type image using Ajax,
What is the question? Do you need to have an example of AJAX so you can build upon it for your app? Or have you got something that is giving you an error?
0
Pravin BnakarAuthor Commented:
I want post image and other data like user name via jquery AJAX to php server .
Here is My form
<form id="datafiles" method="post" enctype="multipart/form-data">
<input type="text" name="first" value="Bob" />
<input type="text" name="middle" value="James" />
<input type="text" name="last" value="Smith" />
<input name="image" type="file" />
<button type="button" class="send_data">Submit</button>
</form>
0
Pravin BnakarAuthor Commented:
What does below line indicate : var formData = new FormData($(this)[0]);
FormData gets all the data from a Form and makes it available for use in an AJAX request. You can read more about it here https://developer.mozilla.org/en/docs/Web/API/FormData
EDIT
This differs from the jQuery serialize() method which does not serialize file data. FormData will serialize any files included in the form.
0
Question has a verified solution.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Open in new window
jQueryOpen in new window
Working sample here