tags:

views:

18

answers:

2

if i have one form that include some input, textarea, select, and multiple file. such as

<form>
<input type="text" id="name" />
<textare id="address"></textarea>
file 1 : <input type="file" id="file[]" name="file[]" />
file 2 : <input type="file" id="file[]" name="file[]" />
file 3 : <input type="file" id="file[]" name="file[]" />
</form>

how to submit a form with input, textarea, checkbox and multiple file with jquery?

can i do it.

+1  A: 

If by "Submit with jQuery" you mean "Ajax Submit" you can use the jquery form plugin.

Note : you're using the same ID for different input elements, which is wrong and will mess up your Javascript if you write some. And don't forget the "enctype="multipart/form-data"" in your opening form tag.

darma
+1  A: 

File uploads are not possible using Ajax. Check out the jQuery form plugin, it uses a hidden iFrame to work around the restriction.

Pekka