050
This commit is contained in:
parent
15fb8c0a41
commit
8aad9db65f
3 changed files with 28 additions and 16 deletions
|
@ -8,7 +8,7 @@ proc htmxEmail*(ctx:Context)=
|
|||
em = ctx.urlForm["em"]
|
||||
val: Validity
|
||||
if em == "":
|
||||
val.message = "Last Name is Required"
|
||||
val.message = "Email is Required"
|
||||
val.mark = "is-invalid"
|
||||
else:
|
||||
val.message = ""
|
||||
|
@ -20,7 +20,7 @@ proc htmxPassword*(ctx:Context)=
|
|||
pw = ctx.urlForm["pw"]
|
||||
val: Validity
|
||||
if pw == "":
|
||||
val.message = "Last Name is Required"
|
||||
val.message = "Password is Required"
|
||||
val.mark = "is-invalid"
|
||||
else:
|
||||
val.message = ""
|
||||
|
@ -44,7 +44,7 @@ proc htmxLastName*(ctx:Context)=
|
|||
ln = ctx.urlForm["ln"]
|
||||
val: Validity
|
||||
if ln == "":
|
||||
val.message = "First Name is Required"
|
||||
val.message = "Last Name is Required"
|
||||
val.mark = "is-invalid"
|
||||
else:
|
||||
val.message = ""
|
||||
|
@ -56,9 +56,9 @@ proc htmxPhone*(ctx:Context)=
|
|||
ph = ctx.urlForm["ph"]
|
||||
val: Validity
|
||||
if ph == "":
|
||||
val.message = "First Name is Required"
|
||||
val.message = "Phone Number is Required"
|
||||
val.mark = "is-invalid"
|
||||
else:
|
||||
val.message = ""
|
||||
val.mark = ""
|
||||
ctx.send htmxPhone(ph,val)
|
||||
ctx.send htmxPhone(ph,val)
|
||||
|
|
|
@ -143,7 +143,7 @@ proc htmxFirstName*(firstName: string, input: Validity): string =
|
|||
|
||||
proc htmxLastName*(lastName: string, input: Validity): string =
|
||||
result = fmt"""
|
||||
<div class="form-group mt-5"
|
||||
<div class="form-group"
|
||||
hx-target="this"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
|
@ -158,7 +158,7 @@ proc htmxLastName*(lastName: string, input: Validity): string =
|
|||
|
||||
proc htmxPhone*(phone: string, input: Validity): string =
|
||||
result = fmt"""
|
||||
<div class="form-group mt-5"
|
||||
<div class="form-group"
|
||||
hx-target="this"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
|
|
|
@ -31,27 +31,39 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-group"
|
||||
hx-target="this"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
<label for="email">Last Name:</label>
|
||||
<label class="text-danger"></label>
|
||||
|
||||
<input type="text" name="ln" class="form-control" required autocomplete="off">
|
||||
<input type="text" name="ln" class="form-control" required autocomplete="off"
|
||||
value=""
|
||||
hx-post="/htmx/lname"
|
||||
>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="email">Email:</label>
|
||||
<label class="text-danger"></label>
|
||||
<!-- <div class="form-group"> -->
|
||||
<!-- <label for="email">Email:</label> -->
|
||||
<!-- <label class="text-danger"></label> -->
|
||||
|
||||
<input type="email" name="em" class="form-control" required autocomplete="off">
|
||||
<!-- <input type="email" name="em" class="form-control" required autocomplete="off"> -->
|
||||
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-group"
|
||||
hx-target="this"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
<label for="email">Phone:</label>
|
||||
<label class="text-danger"></label>
|
||||
|
||||
<input type="email" name="ph" class="form-control" required autocomplete="off">
|
||||
<input type="email" name="ph" class="form-control" required autocomplete="off"
|
||||
value=""
|
||||
hx-post="/htmx/phone"
|
||||
>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue