[RESOLVED]MVC 5 Dynamically show/hide textbox

I need to dynamically show/hide a textbox based on the value of a combobox. ComboBox is bound to a property in the model.

When I change the selected i need to show the textbox.

use combox change event and jquery to hide / show the textbox.

Can you please post an example? Note: I am using @Html.EnumDropDownListFor

   //check the value and use

Hi preetahb,

Thanks for your post.

To do this you must attach an event on "change" event of the select (and hide the text input first). like this according to your own requirement to modify this and use it:

    if ($(this).val() === "Other"){

Source link:

how to hide and show text box according to select value using jquery

Hope this can be helpful.

Best Regards,


Leave a Reply