Sat*_*tti 1 angular angular4-forms
通过按 Enter 键需要以下面的角度 4 提交表单是我表单中的代码Action = ""不起作用。我还尝试使用(keydown) = domonething(event)和(keydown.enter) = domonething(event)
使用以下代码
keyDownFunction(event) {
if (event.keyCode == 13) {
this.submit();
}
}
Run Code Online (Sandbox Code Playgroud)
下面是我当前的代码
<form #f="ngForm" (ngSubmit)="f.form.valid && openModal(confirmationmodal)" novalidate action="">
<div class="form-group form-row">
<label class="col-form-label col-sm-4 col-md-4" for="name">Employee Name</label>
<div class="col-sm-8 col-md-8">
<span type="text" readonly class="form-control-plaintext" id="name">{{employeeDetails.EmployeeName}}</span>
</div>
</div>
<div class="form-group form-row">
<label class="col-form-label col-sm-4 col-md-4 " for="name">Manager Name</label>
<div class="col-md-8 col-sm-8">
<span type="text" readonly class="form-control-plaintext"
id="manager">{{employeeDetails.ManagerName}}</span>
</div>
</div>
<div class="form-group form-row">
<label for="name" class="col-sm-4 col-md-4 col-form-label">Subject</label>
<div class="col-md-8 col-sm-8">
<span type="text" readonly class="form-control-plaintext" id="manager">{{subject}}</span>
</div>
</div>
<button class="btn btn-success float-right" type="submit" id="submit">Submit</button>
</form>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7103 次 |
| 最近记录: |