I am facing a situation where my UI contains multiple text boxes and dropdown fields. My goal is to activate a button on the UI as soon as one of these fields has a value. I have set up a function that is triggered by the ngModel values assigned to these fields. However, I am running into an issue where the disabled property of the button does not change based on the values selected in the dropdowns. The property seems to remain static and does not update with the changes in values.
The HTML code snippet looks like this:
<button [disabled]="searchButtonStatus(x,y, z, a, b,
c, d, e, f, g,
h, i, j)" </button>
...
<td class="empty-cell" id="checkbox" ></td>
...
<!--Batch ID-->
<td class="input-cell">
<input class="form-control form-textbox input-text"
id="requestID" [(ngModel)]="a" name="batch">
<span class="glyphicon glyphicon-search search-glyph"></span>
</td>
...
Furthermore, the disable property triggers the following function which consistently returns the same value:
searchButtonStatus(fndgStatTyp,lnCrtfnStatTyp,fndgHldInd,fndgSmssBchId, prtyRoleAltId,
lglEntyFullNme, ddfLnId, lnAltId, uiFndgSmssDttm, uiFndgSchdDt,
busEvntTypEffDt, finsDwlTyp, fndgColtUpbAmt){
const value:Boolean = !(fndgStatTyp == null || lnCrtfnStatTyp ==null || fndgHldInd == null ||fndgSmssBchId == null || prtyRoleAltId == null ||
lglEntyFullNme == null || ddfLnId == null || lnAltId == null || uiFndgSmssDttm == null || uiFndgSchdDt == null ||
busEvntTypEffDt == null || finsDwlTyp == null || fndgColtUpbAmt == null)
return value;
}