I have a model with a method defined as:
public bool isQuantityInRange(int qty){}
But I need to access this from a JavaScript parser in a method similar to the following:
<input id="QuantityTextBox" name="quantity" type="number" value="@Model.Quantity" style="width: 50px" />
@using (Script.Foot())
{
<script type="text/javascript">
var validateQuantity = function () {
if ([email protected]($("#QuantityTextBox").val())) {
// do some stuff
else {
// do different stuff
}
$("#QuantityTextBox").change(validateQuantity);
validateQuantity();
</script>
Granted, I can't access the value of the textbox from inside the cs statement. How do I do something like this?