Hello, I need to implement a simple dropdown list in an existing form using MVC architecture with SQL server. Our frontend utilizes TypeScript with Knockout.
The adjustment required is straightforward - adding a dropdown list with 3 values: "Not chosen", "Yes", and "No". The model property is of type bool?. The initial value should be "Not chosen", and if the user saves the form with this value, "null" should be saved to the DB.
I attempted the following:
<select id="selectForTaxPurposes"
data-bind="booleanValue: $data.model.forTaxPurposes,
<option id="nothing" value="null">Choose</option>
<option id="yes" value="true">Yes</option>
<option id="no" value="false">Ne</option>
</select>¨
However, the form fails to load. Does anyone have any advice on how to address this issue? I've come across some solutions, but they seem overly complex for this scenario.