provide the generic input field formlet
HTML5 defines input types such as "email" or "date". Provide a generic formlet so that we don't have to cover this ever-growing set piece-by-piece. Signed-off-by: Jan Dvořák <mordae@anilinux.org>
This commit is contained in:
parent
8b987a8ff5
commit
650e9980cb
|
@ -294,6 +294,17 @@ These @tech{formlet}s are the main combinators for form input.
|
||||||
name.
|
name.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@defproc[(input [#:type type string?]
|
||||||
|
[#:value value (or/c false/c bytes?) #f]
|
||||||
|
[#:size size (or/c false/c exact-nonnegative-integer?) #f]
|
||||||
|
[#:max-length max-length (or/c false/c exact-nonnegative-integer?) #f]
|
||||||
|
[#:read-only? read-only? boolean? #f]
|
||||||
|
[#:attributes attrs (listof (list/c symbol? string?)) empty])
|
||||||
|
(formlet/c (or/c false/c binding?))]{
|
||||||
|
This @tech{formlet} renders using an INPUT element with specified type
|
||||||
|
and arguments.
|
||||||
|
}
|
||||||
|
|
||||||
@defproc[(text-input [#:value value (or/c false/c bytes?) #f]
|
@defproc[(text-input [#:value value (or/c false/c bytes?) #f]
|
||||||
[#:size size (or/c false/c exact-nonnegative-integer?) #f]
|
[#:size size (or/c false/c exact-nonnegative-integer?) #f]
|
||||||
[#:max-length max-length (or/c false/c exact-nonnegative-integer?) #f]
|
[#:max-length max-length (or/c false/c exact-nonnegative-integer?) #f]
|
||||||
|
|
|
@ -313,6 +313,14 @@
|
||||||
"")))))
|
"")))))
|
||||||
|
|
||||||
(provide/contract
|
(provide/contract
|
||||||
|
[input (()
|
||||||
|
(#:type string?
|
||||||
|
#:value (or/c false/c bytes?)
|
||||||
|
#:max-length (or/c false/c exact-nonnegative-integer?)
|
||||||
|
#:read-only? boolean?
|
||||||
|
#:attributes (listof (list/c symbol? string?))
|
||||||
|
. ->* .
|
||||||
|
(formlet/c (or/c false/c binding?))))]
|
||||||
[text-input (()
|
[text-input (()
|
||||||
(#:value (or/c false/c bytes?)
|
(#:value (or/c false/c bytes?)
|
||||||
#:size (or/c false/c exact-nonnegative-integer?)
|
#:size (or/c false/c exact-nonnegative-integer?)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user