From 5d04b56c11d0be8be0929ccc06d301a55fac5c17 Mon Sep 17 00:00:00 2001 From: carson Date: Fri, 29 May 2020 14:36:34 -0700 Subject: [PATCH] improve demo: https://github.com/bigskysoftware/htmx/issues/62 --- www/examples/inline-validation.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/www/examples/inline-validation.md b/www/examples/inline-validation.md index 6827d876..763d7e6b 100644 --- a/www/examples/inline-validation.md +++ b/www/examples/inline-validation.md @@ -87,7 +87,7 @@ Below is a working demo of this example. The only email that will be accepted i // routes init("/demo", function(request, params){ - return formTemplate(); + return demoTemplate(); }); onPost("/contact", function(request, params){ @@ -106,8 +106,13 @@ Below is a working demo of this example. The only email that will be accepted i }); // templates - function formTemplate(page) { - return `

Signup Form

+ function demoTemplate() { + + return `

Signup Form

Enter an email into the input below and on tab out it will be validated. Only "test@test.com" will pass.

` + formTemplate(); + } + + function formTemplate() { + return `
@@ -121,7 +126,7 @@ Below is a working demo of this example. The only email that will be accepted i
- +
`; }