diff --git a/src/a3.nim b/src/a3.nim index 844f604..a687c80 100644 --- a/src/a3.nim +++ b/src/a3.nim @@ -368,7 +368,6 @@ import "/lname" -> post: var lname = ctx.urlForm["c_lname"] - echo lname var val: Validity if lname == "": val.message = "Last Name is Required" @@ -380,7 +379,6 @@ import "/validation/fname" -> post: var fname = ctx.urlForm["c_fname"] - echo fname var val: Validity if fname == "": val.message = "First Name is Required" @@ -392,7 +390,6 @@ import "/validation/address" -> post: var address = ctx.urlForm["c_address"] - echo address var val: Validity if address == "": val.message = "Address is Required" @@ -402,6 +399,18 @@ import val.class = "text-success" ctx.send sendAddress(address, val) +"/validation/state" -> post: + var state = ctx.urlForm["c_state_country"] + echo state + var val: Validity + if state == "": + val.message = "State is Required" + val.class = "text-danger" + else: + val.message = "" + val.class = "text-success" + ctx.send sendState(state, val) + "/contact" -> get: var diff --git a/src/a3a/checkout.nimja b/src/a3a/checkout.nimja index 520d80f..f5d45d7 100644 --- a/src/a3a/checkout.nimja +++ b/src/a3a/checkout.nimja @@ -141,7 +141,6 @@ hx-swap="outerHTML" > - {# #}
-
+
- - + {# #} +
diff --git a/src/a3pkg/htmx.nim b/src/a3pkg/htmx.nim index b06dafc..e076c59 100644 --- a/src/a3pkg/htmx.nim +++ b/src/a3pkg/htmx.nim @@ -55,4 +55,21 @@ proc sendAddress*(address: string, input: Validity): string = value="{address}" >
+ """ + +proc sendState*(state: string, input: Validity): string = + result = fmt""" +
+ + + +
""" \ No newline at end of file