Option on Change().
parent
27867ce4b9
commit
a1a4512a5a
Binary file not shown.
Binary file not shown.
|
|
@ -15,6 +15,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="jQuery" Version="3.7.1" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.17" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.17" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.17">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.17">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||||
<div class="form-group col-md-8">
|
<div class="form-group col-md-8">
|
||||||
<label asp-for="FAKTURA.ZakaznikID" class="control-label"></label>
|
<label asp-for="FAKTURA.ZakaznikID" class="control-label"></label>
|
||||||
<select asp-for="FAKTURA.ZakaznikID" class="form-select" asp-items="ViewBag.Zakaznici"></select>
|
<select id="fakturaZakaznikSelect" asp-for="FAKTURA.ZakaznikID" class="form-select" asp-items="ViewBag.Zakaznici"></select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
|
|
@ -200,6 +200,29 @@
|
||||||
<a asp-page="Index">Back to List</a>
|
<a asp-page="Index">Back to List</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$("#fakturaZakaznikSelect").change(function () {
|
||||||
|
//var id = $(this).find(':selected')[0].id;
|
||||||
|
alert("Hello: ");
|
||||||
|
//$.ajax({
|
||||||
|
// type: "POST",
|
||||||
|
// url: "/GetZakaznik",
|
||||||
|
// data: { "name": "pokus" },
|
||||||
|
// success: function (response) {
|
||||||
|
// alert("Hello: " + response.Name + " .\nCurrent Date and Time: " + response.DateTime);
|
||||||
|
// },
|
||||||
|
// failure: function (response) {
|
||||||
|
// alert(response.responseText);
|
||||||
|
// },
|
||||||
|
// error: function (response) {
|
||||||
|
// alert(response.responseText);
|
||||||
|
// }
|
||||||
|
//});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@section Scripts {
|
@section Scripts {
|
||||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,10 +48,10 @@ namespace FakturyWeb.Pages.Faktury
|
||||||
return RedirectToPage("./Index");
|
return RedirectToPage("./Index");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<ContentResult> OnGetZakaznik(int zakaznikID)
|
public ActionResult GetZakaznik(string lastname)
|
||||||
{
|
{
|
||||||
// vrat zakaznika
|
|
||||||
//viz: https://stackoverflow.com/questions/68854396/how-do-i-load-form-fields-based-on-a-value-changed-in-a-dropdownlist-in-my-asp-n
|
return Page();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@
|
||||||
<link rel="stylesheet" href="~/css/site.css" />
|
<link rel="stylesheet" href="~/css/site.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
@ -50,7 +52,7 @@
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
|
||||||
<script src="~/lib/bootstrap-5.3.1-dist/js/bootstrap.js"></script>
|
<script src="~/lib/bootstrap-5.3.1-dist/js/bootstrap.js"></script>
|
||||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue