我正在做一个项目,其中有一个带有单选按钮的表单。我需要仅在选择相应的单选按钮时才需要某些输入字段
我需要如何检查单选按钮并相应地设置所需的数字输入字段。如果 *ngIf 尝试了很多方法和种类,但我无法获得正确的形式
提前谢谢 看这里
<form (ngSubmit)="onSumbit(f)" id="form" #f="ngForm">
<!-- <form method="POST" action="#"> -->
<h5>Filter für Rechnungsgröße
<fa-icon class="icn" [icon]="faQuestionCircle" placement="right" ngbTooltip="choosing the upper limit to Be zero means it is unlimited, also form zero to zero is denied"></fa-icon>
</h5>
<div>
<div>
<input type="radio" name="unlimtedRange" id="unlimtedRange" required>
<label class="form-control-label" for="choiceUnlimted">unlimitiert</label>
</div>
<div>
<input type="radio" name="unlimtedRange" id="limtedRange" required>
<label class="form-control-label" for="choiceLimted">limitiert</label>
<div class="reveal-if-active">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">von</span>
<span class="input-group-text">€</span>
</div>
<input type="number" class="form-control" name="from" id="from" [(ngModel)]="fromVal" #from="ngModel" ngModel>
</div>
<div class="input-group">
<input type="number" class="form-control" name="to" id="to" [(ngModel)]="toVal" #to="ngModel" ngModel>
<div class="input-group-append">
<span class="input-group-text">€</span>
<span class="input-group-text">bis</span>
</div>
</div>
<span class="help-block" *ngIf="to.value < from.value && to.value !== 0">to field can not be smaller than from field !</span>
</div>
</div>
</div>
<div class="section">
<h5>Anzeigedauer einer Forderung</h5>
<div class="inp">
<input type="number" name="remainTime" id="remainTime" class="form-control" placeholder="Maximum 90 days" title="Maximal 90 Tage" [(ngModel)]="remainTimeVal" [formControl]="myControl" ngModel required>
</div>
<div>
<button type="submit" class="btn btn-success" role="button">Annehmen</button>
<a href="/#" class="btn btn-light" role="button">Zurücksetzen</a>
<span>
<p id="demo">
</p>
</span>
</div>
</div>
</form>