我有两个不同文件的输入标签,例如一个用于图像,下一个用于表单内的 pdf 文件,用于验证一切都按预期工作,但最后一个输入标签始终为空,如果我删除一个,则表单无效输入标签然后它按预期工作。
<form
enctype="multipart/form-data"
[formGroup]="reactiveForm"
(ngSubmit)="submit()"
>
<h3>Add New Magazine</h3>
<div class="form-group p-2">
<label for="exampleInputEmail1">Magazine Name</label>
<input
type="email"
name="email"
class="form-control"
placeholder="Magazine Name"
required
formControlName="magazineName"
/>
</div>
<div class="form-group p-2">
<label for="exampleInputEmail1">Magazine Month & year</label>
<br />
<div class="input-group">
<input
class="form-control"
placeholder="yyyy-mm-dd"
name="dp"
ngbDatepicker
formControlName="publishDate"
#d="ngbDatepicker"
/>
<div class="input-group-append">
<button
class="btn btn-outline-secondary"
(click)="d.toggle()"
type="button"
>
<i class="fa fa-calendar-o" aria-hidden="true"></i>
</button>
</div>
</div>
</div>
<div class="form-group p-2">
<label for="exampleInputEmail1">Magazine Brand</label>
<br />
<div class="form-group">
<select
class="custom-select"
required
formControlName="magazineBrand"
>
<option value="">Open this select menu</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
</div>
</div>
胡说叔叔
相关分类