我有一个主要表单,其中包含填充的问题。每个问题都需要能够上传文件。
这是我遇到问题的地方,因为您无法在表单中找到表单。通过文件上传,他们喜欢自己的形式。外形(answer_audit.php?action=post
)试图控制子形式。这个问题有方法解决吗?
我打破了代码以显示我的意思,如果需要,我可以添加更多代码,但我试图尽可能地将其限制为PHP和html:
<form role="form" action="./answer_audit.php?action=post" method="post" enctype="multipart/form-data" name="auditForm" id="auditForm" >
<a title='Upload file' href='#' do_disable='$disabled' id=$row[questionID] class='btn btn-default btn-xs “ data-toggle='modal' data-target='#uploaded_files_$row[questionID]’>
<!-- modal pop up -->
<div class='modal fade' style='z-index:10000' id='uploaded_files_$row[questionID]' role='dialog'>
<div class='modal-dialog modal-lg'>
<div class='modal-content'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal' aria-hidden='true'></button>
<h4 class='modal-title'>Title</h4>
</div>
<div class='modal-body'>
<form id='my_form_1$row[questionID]' name='form' action='ajax/upload.php' method='POST' enctype='multipart/form-data' target='_blank'>
<h1>Upload File</h1>
<strong>File: </strong><input name='myFile' id='myFile' type='file' />
<input id='$row[questionID]' class='upload_button' name='action' value='Upload' type='button' />
<iframe id='my_iframe' name='my_iframe' src=''></iframe>
</form>
</div>
<div class='modal-footer'>
<button type='button' class='btn btn-default' data-dismiss='modal'>Close</button>
</div>
</div>
</div>
</div>
<input class="btn btn-lg btn-success finish_button" type="button" ID="" value="Finish"/>
</form>