I have an idea, and I thought it would be as straight-forward as adding JavaScript to populate a text box based on calling a method from my drop-down lists onchange event (Shown Below):
<div class="form-group">
<label asp-for="DrinkOrdered" class="control-label"></label>
<Select asp-for="DrinkOrdered" class="form-control" onchange="FindTotal()" id="DrinkSelector">
<option value="none" selected disabled hidden>
--Select a Drink--
</option>
<option value="Bourbon Old Fashioned">Bourbon Old Fashioned</option>
<option value="Negroni">Negroni</option>
<option value="Manhattan">Manhattan</option>
<option value="Long Island Iced Tea">Long Island Iced Tea</option>
<option value="White Russian">White Russian</option>
<option value="Margarita">Margarita</option>
<option value="Bloody Mary">Bloody Mary</option>
<option value="Dirty Martini">Dirty Martini</option>
<option value="Painkiller">Painkiller</option>
<option value="Aperol Spritz">Aperol Spritz</option>
<option value="Other">Other</option>
</Select>
</div>
however, through research have learned that since JavaScript is a client-side language and Razor-Views are server side,this isnt possible to get both the functionality of displaying the value on the page AND passing the value from the current view to controller
I have tried both changing the value of the text box as well as changining the innerhtml of a div element.
Is there someway this is possible with an ASP.Net -core strongly typed text box? I am simply trying to change the value in this text box based on the value that is changed in the drop-down list above. (Showing the total for a drink that is picked) I have gotten both sides; using a text-box, and showing the value on my view that creates an order, but the value doesnt get passed to the controller. When removing the validation and reverting to the strongly typed text box I was able to pass the value to my controller, but not show the value on the view in the text box.
I apologize for the word wall