开发者

submit form with textarea and multiple file?

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"></tex开发者_如何学Ctarea>
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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜