我建立一种内部沟通工具,用户可以发表评论和附加文件内Blueimp文件上传。表 - 用另一种形式
我使用的是蓝色的小鬼文件上传:https://github.com/blueimp/jQuery-File-Upload/
而且我做了这里的jsfiddle:http://jsfiddle.net/denislexic/s56xG/12/
但简化,我在这里做了摘录:
<form action="/path/to/submit/" method="post" style="padding:10px;">
<textarea style="display:block; width:60%;"></textarea>
<form id="fileupload" action="server/php/" method="POST" enctype="multipart/form-data">
<!-- Blue imp form stuff in here -->
</form>
<a href="#" class="btn JS_fileUpload">Attach file</a>
<button type="submit" class="btn btn-primary">Post</button>
</form>
问题是,设计明智的,我真的需要提交按钮后面的textarea和文件上传,文件上传必须介于...所以这意味着我必须嵌套窗体(这并不工作)?还有其他解决方案吗?
PS:我已经看到了这个问题,但似乎并没有相关:Submitting form located within another form
预先感谢任何帮助。
嵌套形式是无效的HTML,所以你需要使用一些CSS来把东西放在一个适当的布局。 – RobG 2012-08-10 02:37:10