coba form

This commit is contained in:
Sas Andy
2024-05-15 13:54:26 +07:00
parent d9ba1f3ce3
commit 4aaf602b21
18 changed files with 2308 additions and 11 deletions

View File

@@ -97,12 +97,12 @@ License: You must have a valid license purchased only from themeforest(the above
<!-- begin::Navbar -->
<div
class="d-flex flex-lg-row justify-content-between py-5"
style="height: 119px; align-items: center"
style="height: 119px; align-items: center;"
>
<img
src="asset-corporate-portal/media/logo.png"
alt=""
style="height: 39px"
style="height: 39px;"
/>
<ul class="nav">
<li class="nav-item dropdown">
@@ -132,7 +132,7 @@ License: You must have a valid license purchased only from themeforest(the above
<img
src="asset-corporate-portal/media/logo.png"
alt=""
style="height: 39px"
style="height: 39px;"
/>
</div>
<div class="p-10">

210
assets/andy/cobaform.html Normal file
View File

@@ -0,0 +1,210 @@
<!DOCTYPE html>
<html lang="en">
<head>
<base href="../" />
<meta charset="utf-8" />
<title>Company Portal | { title }</title>
<meta name="description" content="Company Portal" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<link rel="stylesheet" href="assets/css/googlefont/poppins.css" />
<link
href="assets/css/pages/login/login-1.css"
rel="stylesheet"
type="text/css"
/>
<link
href="assets/plugins/global/plugins.bundle.css"
rel="stylesheet"
type="text/css"
/>
<link
href="assets/plugins/custom/prismjs/prismjs.bundle.css"
rel="stylesheet"
type="text/css"
/>
<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
<link
href="assets/css/themes/layout/header/base/light.css"
rel="stylesheet"
type="text/css"
/>
<link
href="assets/css/themes/layout/header/menu/light.css"
rel="stylesheet"
type="text/css"
/>
<link
href="assets/css/themes/layout/brand/dark.css"
rel="stylesheet"
type="text/css"
/>
<link
href="assets/css/themes/layout/aside/dark.css"
rel="stylesheet"
type="text/css"
/>
<link
rel="shortcut icon"
href="asset-corporate-portal/media/logo/logo-small.jpg"
/>
<link
href="asset-corporate-portal/css/sas.bundle.css"
rel="stylesheet"
type="text/css"
/>
<link rel="stylesheet" href="assets/css/googlefont/publicsans.css" />
<link rel="stylesheet" href="assets/css/googlefont/roboto.css" />
<link rel="stylesheet" type="text/css" href="assets/css/slick/slick.css" />
<link
rel="stylesheet"
type="text/css"
href="assets/css/slick/slick-theme.css"
/>
<link
rel="stylesheet"
type="text/css"
href="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css"
/>
</head>
<script src="assets/js/htmx/htmx.min.js"></script>
<body
id="kt_body"
class="header-fixed header-mobile-fixed subheader-enabled subheader-fixed subheader-mobile-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading bg-white"
>
<div class="p-6">
<form
hx-post="http://localhost:5000/dev/usergroup/add"
class="form"
hx-target="#change"
hx-swap="innerHTML"
hx-on::after-request="showtoast()"
hx-on::reponse-error="cobaerror()"
hx-on::send-error="cobaerror()"
id="kt_form_1"
>
<div id="change">
<div class="form-group">
<label
class="text-black"
style="font-family: Poppins; font-weight: 600;"
>Code
</label>
<input
id="codeug"
name="usergroupcode"
type="text"
placeholder="coba"
value=""
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
/>
<div class="invalid-feedback text-danger mt-3">
Shucks, check the formatting of that and try again.
</div>
<label
class="text-black"
style="font-family: Poppins; font-weight: 600;"
>Name
</label>
<input
id="nameug"
name="usergroupname"
type="text"
placeholder="coba"
value=""
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
/>
</div>
</div>
<button id="btnsbmt" class="btn btn-primary m-9" type="submit">
submit
</button>
</form>
</div>
<div id="testttt" class="p-6" hx-swap-oob="#testttt">
;adkj;djf;
</div>
<button
type="button"
onclick="showtoast()"
class="btn btn-primary"
id="liveToastBtn"
>
Show live toast
</button>
<div
class="position-fixed bottom-0 right-0 p-3"
style="z-index: 5; right: 0; bottom: 0;"
>
<div
id="liveToast"
class="toast hide"
role="alert"
aria-live="assertive"
aria-atomic="true"
data-delay="2000"
>
<div class="toast-header">
<img src="..." class="rounded mr-2" alt="..." />
<strong class="mr-auto">Bootstrap</strong>
<small>11 mins ago</small>
<button
type="button"
class="ml-2 mb-1 close"
data-dismiss="toast"
aria-label="Close"
>
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="toast-body">
Hello, world! This is a toast message.
</div>
</div>
</div>
<!--begin::Global Config(global config for global JS scripts)-->
<script src="asset-corporate-portal/js/ktappsetting.js"></script>
<!--end::Global Config-->
<!--begin::Global Theme Bundle(used by all pages)-->
<script src="assets/plugins/global/plugins.bundle.js"></script>
<script src="assets/plugins/custom/prismjs/prismjs.bundle.js"></script>
<script src="assets/js/scripts.bundle.js"></script>
<!--end::Global Theme Bundle-->
<script src="assets/js/iconify/iconify.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
<script>
function showtoast() {
let code = document.querySelector("#usergroupname");
let name = document.querySelector("#usergroupcode");
if (
name.classList.contains("is-invalid") ||
code.classList.contains("is-invalid")
) {
toastr.error("New order has been placed!");
} else {
toastr.success("New order has been placed!");
}
}
function cobaerror() {
toastr.error("error");
}
</script>
<!--end::Page Scripts-->
</body>
</html>