我想根據組合框選擇啓用/禁用文本框...如果選擇value=""
,我希望內容文本框是禁用。我嘗試了很多東西,但沒有任何工作... 任何想法,如何我可以解決這個問題?根據組合框選擇啓用文本框
<form method="post" class="form-horizontal" [formGroup]="formulario">
<div class="form-group row">
<label class="control-label col-md-3 text-right" for="SearchField">Field:</label>
<div class="col-sm-3 col-md-3">
<select formControlName="SearchField" class="form-control" (change)="choice(searchField.value)" #searchField>
<option value="" selected disabled>Pick a Choice</option>
<option value="1">Choice 1</option>
<option value="2">Choice 2</option>
<option value="3">Choice 3</option>
<option value="4">Choice 4</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="control-label col-md-3 text-right" for="ContentField">Content: </label>
<div class="col-sm-3 col-md-3">
<input type="text" class="form-control" formControlName="ContentField" [textMask]="mask" [(ngModel)]="search" placeholder="{{ this.searchKind }}" #docField />
</div>
</div>
Thanks !!!我已經做了一些調整,它的工作! –