我有一个包含多个文件上传表单的页面。哪些是循环生成的。
问题:第一个文件上传控制有效,其余的则无效。
<div>
<form action="/docs/1046/UploadDocument?Id=1046&propertyTypeId=1" enctype="multipart/form-data" method="post">
<input name="X-HTTP-Method-Override" type="hidden" value="PUT">
<div style="display: none">
<label for="fileCOMMERCIAL_TRANSPORT_LICENSE"></label>
<input id="fileCOMMERCIAL_TRANSPORT_LICENSE" name="fileCOMMERCIAL_TRANSPORT_LICENSE" type="file" onchange=" $('#btnSubmitData').click(); ">
<input id="btnSubmitData" type="submit" onclick=" txt = $('#fileCOMMERCIAL_TRANSPORT_LICENSE').val(); alert(txt); ">
</div>
<div>
<label>
Document 1:
</label>
<button type="button" onclick=" $('#fileCOMMERCIAL_TRANSPORT_LICENSE').click(); ">Upload 1</button>
</div>
</form>
<form action="/docs/1046/UploadDocument?Id=1046&propertyTypeId=5" enctype="multipart/form-data" method="post">
<input name="X-HTTP-Method-Override" type="hidden" value="PUT">
<div style="display: none">
<label for="fileCLEAN_CRIMINAL_RECORD"></label>
<input id="fileCLEAN_CRIMINAL_RECORD" name="fileCLEAN_CRIMINAL_RECORD" type="file" onchange=" $('#btnSubmitData').click(); ">
<input id="btnSubmitData" type="submit" onclick=" txt = $('#fileCLEAN_CRIMINAL_RECORD').val(); alert(txt); ">
</div>
<div>
<label>
Document 2:
</label>
<button type="button" onclick=" $('#fileCLEAN_CRIMINAL_RECORD').click(); ">Upload 2</button>
</div>
</form>
</div>