Since the name of your property is Kund
, second helper creates a select element which has both id
and name
fields set to Kund
. On the other hand your script uses id country
to address this select. So you have two options:
Change id used in the script to
#Kund
:$("#Kund").change(function () { if ($("#Kund").val() != "Please select") {
Use first helper with correct name and id:
@Html.DropDownList("Kund", ViewData["kundLista"] as SelectList), new {@id="country"})