summaryrefslogtreecommitdiff
path: root/forms.fnl
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2025-10-03 11:56:37 +0600
committerunwox <me@unwox.com>2025-10-13 23:11:01 +0600
commit3f5ade2e7a139bb4405437e8fc5546aafc7b05ef (patch)
tree77c437958d74b591f11ec207d16749cf207a51e3 /forms.fnl
parentf5a70e6a446e00969adb866ef2e2d10bf33bc4a8 (diff)
WIP shop
Diffstat (limited to 'forms.fnl')
-rw-r--r--forms.fnl8
1 files changed, 5 insertions, 3 deletions
diff --git a/forms.fnl b/forms.fnl
index 9b035e1..c75daec 100644
--- a/forms.fnl
+++ b/forms.fnl
@@ -245,9 +245,11 @@
(table.concat
(icollect [_ field (ipairs group.fields)]
(field.html (. data field.name) (. errors field.name))))]))
- (HTML [:button {:type "submit"} "Сохранить"])))]))
+ (HTML [:button {:type "submit"
+ :onclick "this.disabled = true; this.form.submit();"}
+ "Сохранить"])))]))
-(fn convert-values-from-html [form data db]
+(fn html-form->data [form data db]
(each [_ group (ipairs form)]
(each [_ field (ipairs group.fields)]
(local value (. data field.name))
@@ -336,7 +338,7 @@
: file-input
: select-input
: render-form
- : convert-values-from-html
+ : html-form->data
: validate-form
: form-insert-sql-statement
: form-update-sql-statement}