diff --git a/src/a3 b/src/a3 index dab44b7..fd178e0 100755 Binary files a/src/a3 and b/src/a3 differ diff --git a/src/a3.nim b/src/a3.nim index 7fc85b1..768bfb8 100644 --- a/src/a3.nim +++ b/src/a3.nim @@ -372,6 +372,17 @@ import val.mark = "" ctx.send sendPhone(phone, val) +"/validation/country" -> post: + var country = ctx.urlForm["c_country"] + var val: Validity + if country == "1": + val.message = "" + val.mark = "is-invalid" + else: + val.message = "" + val.mark = "" + ctx.send sendCountry(country, val) + "/contact" -> get: var diff --git a/src/a3pkg/htmx.nim b/src/a3pkg/htmx.nim index d5131e7..351fef4 100644 --- a/src/a3pkg/htmx.nim +++ b/src/a3pkg/htmx.nim @@ -152,7 +152,10 @@ proc sendCheckOut*(val: Table[string, Validity], total: string): string =
- @@ -482,3 +485,28 @@ proc sendThankYou*(): string=
""" + +proc sendCountry*(country: string, input: Validity): string = + + var rep = """ + + + + + + + + + + """ + + var rep1 = rep.replace(fmt"{country}", fmt"{country} selected") + + result = fmt""" + + """