Hi, I have an MVC project and I'm using a server's database. In the project I do the consultations with javascript, and it happens that I have an input to select the date in a calendar and an option to select the name of a user already loaded from the database.
My question is how to show the other fields of the user (in the div called "data") according to the name and date selected by clicking on the button see ...
In other words, how to translate: "Select * from table where user=" + inputUser + "and date=" + inputdate + "'"; in javascript language and / or ajax. I really do not have much idea here I leave my html code:
<div class="col-md-5">
<select class="form-control" name="IdGestor">
<option></option>
@{
if (Model.UsersList != null)
{
foreach (Users users in Model.UsersList)
{
<option value="@gestores.id">@users.Nombre</option>
}
}
else
{
<option value="0"> No hay usuarios </option>
}
}
</select>
</div>
<div class="col-md-5">
<input type="date" class="form-control" id="Fecha" placeholder="Fecha" required pattern="[0-9]{2}-[0-9]{2}-[0-9]{4}" />
<span class="validity"></span>
</div>
<div class="col-md-2">
<a href="#" class="btn btn-link dropdown-toggle" id="ver" style="font-size:20px" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" title="Ver">
<span class="fa fa-search">Ver</span>
</a>
</div>
<div id="datos"></div>