Skip to content Skip to sidebar Skip to footer

Change Label On Change DropDownListFor Value

I use a DropDownListFor and a label text on my page. <%=Html.DropDownListFor(x => x.MotiveClientType, new SelectList( Mode

Solution 1:

I'm not aware of any functionality native to ASP.NET MVC that will allow you to do this, but doing it with jQuery is a fairly trivial matter. Here's an example of hooking up an event handler to the change event of the dropdown & then setting the label text:

$("#DropDownID").change(function () {
    $("#LabelID").text("Your text here");
});

Just replace the IDs with the relevant values.


Post a Comment for "Change Label On Change DropDownListFor Value"