2016-08-23 72 views
0

我想要一个多重输入的表单,但不使用<input type=submit><button>。 (因为按钮不被IE支持,并且<input type="submit">显示文本值,我想要一个图像而不是按钮内的文本)。问题是该表单发送“null”值而不是value="${CdFile.path}" 感谢您的帮助!如何在HTML表单中使用多个<input type =“image”>?

<form action="depending of the input choosen" method="post" id="ContactForm" enctype="multipart/form-data"> 
 
    <table id="table_id" class="display" width="100%" cellspacing="1" cellpadding="0" border="1" align="left" bgcolor="#999999"> 
 
    <caption> Files of current user</caption> 
 
    <thead> 
 
    <tr> 
 
     <th>Download</th> 
 
     <!--th>Directory</th--> 
 
     <th>file Name</th> 
 
     <th>document type</th> 
 
     <th>Date</th> 
 
    </tr> 
 
    </thead> 
 
    <tbody> 
 
    <tr> 
 
     <td> 
 
      <input type="image" width="50" name="subject" src=" http://res.cloudinary.com/virbac/image/upload/v1471939749/download_smaflx.png" border="0" alt="Submit" value="${CdFile.path}" /> 
 
     </td> 
 
     <!--td>${CdFile.folder}</td--> 
 
     <td>${CdFile.fileName}</td> 
 
     <td>${CdFile.docType}</td> 
 
     <td>${CdFile.date}</td> 
 
    </tr> 
 
    <tr> 
 
     <td> 
 
      <input type="image" width="50" name="subject" src=" http://res.cloudinary.com/virbac/image/upload/v1471939749/download_smaflx.png" border="0" alt="Submit" value="${CdFile.path}" /> 
 
     </td> 
 
     <!--td>${CdFile.folder}</td--> 
 
     <td>${CdFile.fileName}</td> 
 
     <td>${CdFile.docType}</td> 
 
     <td>${CdFile.date}</td> 
 
    </tr> 
 
    <tr> 
 
     <td> 
 
      <input type="image" width="50" name="subject" src=" http://res.cloudinary.com/virbac/image/upload/v1471939749/download_smaflx.png" border="0" alt="Submit" value="${CdFile.path}" /> 
 
     </td> 
 
     <!--td>${CdFile.folder}</td--> 
 
     <td>${CdFile.fileName}</td> 
 
     <td>${CdFile.docType}</td> 
 
     <td>${CdFile.date}</td> 
 
    </tr> 
 
    </tbody> 
 
    </table> 
 
</form>

+0

你能更清楚一点你的问题吗 –

+0

是的,当然,我有一些服务器上的文件,我想让他们downloada可见,我的表单实际上与传统的输入一起工作,输入的值是文件的路径。但是这个值显示在按钮中,我想要一个图像而不是文本显示 – cryckx

+0

所以当点击'输入[提交]'文件应该下载。或者它可以打开它在新标签页查看图像 –

回答

0

不能添加图像的按钮里面,但你可以超链接标签中嵌入图像这样

<a href="http://example.com/data.zip"> 
    <img src="/image.jpg" alt="download"> 
</a> 

这将一个图像转换为按钮

+0

谢谢你,但我无法使用超链接访问文件,我使用套接字技术来流式传输选定的文件 – cryckx

+0

它不是button.its超链接 –

+0

那么它是什么意思? :)“这会将图像转换为按钮” –

相关问题