Thursday, 21 January 2021

jQuery - call jQuery on dropdownlist change

 Watch this example on YouTube


 

@model WebApplication1.Models.OrderCustomClass

@using (Html.BeginForm("Index", "Home"))
{
  @Html.DropDownListFor(x=>x.or.ProductID, new SelectList(Model.prod, "ProductID", "Name", Model.prod), "")

}

   

    @section Scripts{
    <script type="text/javascript">
        $("#or_ProductID").change(function () {
            alert("changed")
        });

    </script>
    }

No comments:

Post a Comment