Skip to content
Advertisement

MVC DropDownList onchange event with value

I’m pretty new to MVC and i’m trying to determine the value of a DropDownList when the value is changed. At the moment the val variable being passed to my javascript function is always ‘undefined’. I’ve googled for the solution and everywhere says to do exactly what i’m doing right now. What am i doing wrong?

cshtml:

JavaScript

And my javascript:

JavaScript

Advertisement

Answer

Try using a lower case ‘v’ for ‘this.Value’

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement