Make the form-horizontal-control procedure aware of hidden inputs

Signed-off-by: Christopher Baines <mail@cbaines.net>
This commit is contained in:
Danjela Lura 2020-05-29 17:27:13 +02:00 committed by Christopher Baines
parent ecd460867b
commit 14cd95f244

View file

@ -133,6 +133,16 @@
(invalid-query-parameter? val)))) (invalid-query-parameter? val))))
(show-help-span? (show-help-span?
(or help-text has-error? required?))) (or help-text has-error? required?)))
(if (string=? type "hidden")
`(input (@ (class "form-control")
(id ,input-id)
(type ,type)
(name ,input-name)
,@(match (assq (string->symbol input-name)
query-parameters)
(#f '())
((_key . value)
`((value ,(value->text value)))))))
`(div `(div
(@ (class ,(string-append (@ (class ,(string-append
"form-group form-group-lg" "form-group form-group-lg"
@ -249,7 +259,7 @@
,@(if help-text ,@(if help-text
(list help-text) (list help-text)
'()))) '())))
'()))))) '()))))))
(define (readme contents) (define (readme contents)
(layout (layout