I have a @Html.DropDownList that I need to have it's text and value changed based off of a prior choice.
if ($(data.agt.CoAgentMLSAID != null) == "True") {
$("#SelectedAgent").html("{0}, {1}", data.agt.CoAgentLastName,
data.agt.CoAgentFirstName);
}
I have also tried this:
$document.getElementById("#SelectedAgent").text = ("{0}, {1}", data.agt.CoAgentLastName, data.agt.CoAgentFirstName);
instead of the other one above. Didn't work
And I have this:
@Html.DropDownList("SelectedAgent", this.Model.OfficeAgents, new { @class = "fl-space2", @id ="SelectedAgent" } )
What I'm getting is the default value and not the value of the names based off of the if statement above. How can I change that? The default text is in the Model.
I'm not very strong with jQuery, so I'm betting it's something quick. Thanks in advance