我有一個多輸入字段的表單。我想添加一個文件作爲文件upload.How我完成這個給定的事實,即HTML不支持嵌套窗體標籤。作爲html格式字段的文件上傳
<form class="form-horizontal" action="profile.php" method="post">
<fieldset>
<!-- Form Name -->
<legend>Jobseeker profile</legend>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="txtaddress">Address</label>
<div class="col-md-4">
<input id="txtaddress" name="txtaddress" type="text" placeholder="" class="form-control input-md">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="txtmob">Mobile</label>
<div class="col-md-4">
<input id="txtmob" name="txtmob" type="text" placeholder="" class="form-control input-md">
</div>
</div>
<!-- Date input --->
<div class="form-group">
<label class="col-md-4 control-label" for="date">DOB</label>
<div class="col-md-4">
<input class="form-control" id="date" name="date" placeholder="MM/DD/YYYY" type="text">
</div>
</div>
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-4 control-label" for="txtqualification">Highest Qualification Achieved<span style="color:red">*</span></label>
<div class="col-md-4">
<select id="txtqualification" name="txtqualification" class="form-control">
<option value="SC">SC</option>
<option value="HSC">HSC</option>
<option value="BSc">BSc</option>
<option value="MS">MS</option>
<option value="Phd">Phd</option>
</select>
</div>
</div>
<!-- File Button -->
<div class="form-group">
<label class="col-md-4 control-label" for="btnChooseUpload">Upload CV<span style="color:red">*</span></label>
<div class="col-md-4">
<input id="btnChooseUpload" name="btnChooseUpload" class="input-file" type="file">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="txtskills">Skills<span style="color:red">*</span></label>
<div class="col-md-4">
<input id="txtskills" name="txtskills" type="text" placeholder="" class="form-control input-md" required="">
</div>
</div>
<!-- Button (Double) -->
<div class="form-group">
<label class="col-md-4 control-label" for="btnSubmit"></label>
<div class="col-md-8">
<button id="btnSubmit" name="btnSubmit" class="btn btn-success">Submit</button>
<button id="btnCancel" name="button2id" class="btn btn-danger">Cancel</button>
</div>
</div>
</fieldset>
</form>
如何添加僅用於文件上傳的enctype="multipart/form-data"
? 另外我想添加一個按鈕,以便用戶可以獨立上載表單上傳文件。
你的問題到底是什麼?爲什麼你需要一個嵌套的表單來包含''? – gyre
如果您也發佈了代碼,我們可能會看到您遇到的問題 – LGSon
@LGSon代碼添加 – user2650277