diff --git a/src/a3 b/src/a3 index 2f0390a..b22047d 100755 Binary files a/src/a3 and b/src/a3 differ diff --git a/src/a3.nim b/src/a3.nim index a687c80..c5dba4c 100644 --- a/src/a3.nim +++ b/src/a3.nim @@ -186,11 +186,11 @@ import products: seq[Products] productCount = 0 countryError = "" - firstNameError = "" - lastNameError = "" - addressError = "" - stateError = "" - zipError = "" + # firstNameError = "" + # lastNameError = "" + # addressError = "" + # stateError = "" + # zipError = "" emailError = "" phoneError = "" ch = "" @@ -260,8 +260,8 @@ import zipError = "" emailError = "" phoneError = "" - passwordError = "" - ch = "" + # passwordError = "" + # ch = "" echo "hi" echo ctx.urlForm echo "bye" @@ -401,7 +401,6 @@ import "/validation/state" -> post: var state = ctx.urlForm["c_state_country"] - echo state var val: Validity if state == "": val.message = "State is Required" @@ -411,6 +410,18 @@ import val.class = "text-success" ctx.send sendState(state, val) +"/validation/zip" -> post: + var zip = ctx.urlForm["c_postal_zip"] + echo zip + var val: Validity + if zip == "": + val.message = "Zip is Required" + val.class = "text-danger" + else: + val.message = "" + val.class = "text-success" + ctx.send sendZip(zip, val) + "/contact" -> get: var diff --git a/src/a3a/checkout.nimja b/src/a3a/checkout.nimja index f5d45d7..d38a02a 100644 --- a/src/a3a/checkout.nimja +++ b/src/a3a/checkout.nimja @@ -165,10 +165,18 @@ name="c_state_country" > -
+ +
- - + {# #} +
diff --git a/src/a3pkg/htmx.nim b/src/a3pkg/htmx.nim index e076c59..4348127 100644 --- a/src/a3pkg/htmx.nim +++ b/src/a3pkg/htmx.nim @@ -66,10 +66,27 @@ proc sendState*(state: string, input: Validity): string = > - + """ + +proc sendZip*(zip: string, input: Validity): string = + result = fmt""" +
+ + + +
""" \ No newline at end of file