I have a form that has two @Html.DropDownListFor and other fields. But when I change the first DropDownListFor I need to update the values of the other dropdownlist by passing its id as parameter ...
@model EP.IdentityIsolation.Domain.Entities.Cadastro.Atividade
@using (Html.BeginForm("SalvarHistoria", "Historia", FormMethod.Post))
{
@Html.AntiForgeryToken()
<div class="form-body">
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.Cliente, htmlAttributes: new { @class = "control-label" })
@Html.DropDownListFor(model => model.Cliente.Id, @ViewBag.ListaClientes, "Nenhum", new { @class = "form-control", required = "true", onchange = "?????" })
<small>@Html.ValidationMessageFor(model => model.Cliente, "", new { @class = "text-danger" })</small>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Oportunidade, htmlAttributes: new { @class = "control-label" })
@Html.DropDownListFor(model => model.Oportunidade.Id, @ViewBag.ListaOportunidades, "Nenhum", new { @class = "form-control", required = "true" })
<small>@Html.ValidationMessageFor(model => model.Oportunidade, "", new { @class = "text-danger" })</small>
</div>
<div class="form-group">
@Html.LabelFor(model => model.IsExecutado, htmlAttributes: new { @class = "control-label" })
<div class="checkbox">
@Html.EditorFor(model => model.IsExecutado)
<small>@Html.ValidationMessageFor(model => model.IsExecutado, "", new { @class = "text-danger" })</small>
</div>
</div>
</div>
<hr />
<div class="form-actions" align="right">
<button type="button" class="btn btn-danger waves-effect waves-light"><i class="fa fa-times" aria-hidden="true"></i></button>
<button type="submit" class="tst3 btn btn-success waves-effect waves-light m-r-10" onclick="validaDataHora();"> <i class="fa fa-check"></i> Salvar</button>
</div>
}