Updating textarea-input re Shogo

This commit is contained in:
Jay McCarthy 2011-06-27 12:08:10 -06:00
parent 2cea046fef
commit 359ac41a45
3 changed files with 18 additions and 4 deletions

View File

@ -220,6 +220,15 @@
(test-equal? "textarea-input"
(test-display (textarea-input #:cols 80 #:rows 70))
'((textarea ([name "input_0"] [rows "70"] [cols "80"]) "")))
(test-equal? "textarea-input"
(test-display (textarea-input #:rows 80 #:attributes '([class "awesome"])))
'((textarea ([name "input_0"] [rows "80"] [class "awesome"]) "")))
(test-equal? "textarea-input"
(test-display (textarea-input #:cols 80 #:attributes '([class "awesome"])))
'((textarea ([name "input_0"] [cols "80"] [class "awesome"]) "")))
(test-equal? "textarea-input"
(test-display (textarea-input #:cols 80 #:rows 70 #:attributes '([class "awesome"])))
'((textarea ([name "input_0"] [rows "70"] [cols "80"] [class "awesome"]) "")))
; checkbox
(test-equal? "checkbox"

View File

@ -223,6 +223,7 @@
#:display display)))
(define (textarea-input
#:attributes [attrs empty]
#:rows [rows #f]
#:cols [cols #f])
(make-input
@ -232,7 +233,8 @@
(append
(filter list?
(list (and rows (list 'rows (number->string rows)))
(and cols (list 'cols (number->string cols)))))))
(and cols (list 'cols (number->string cols)))))
attrs))
""))))
(provide/contract
@ -307,8 +309,10 @@
. ->* .
(formlet/c any/c))]
[textarea-input (()
(#:rows number?
#:cols number?)
(#:attributes
(listof (list/c symbol? string?))
#:rows number?
#:cols number?)
. ->* .
(formlet/c (or/c false/c binding?)))])

View File

@ -305,7 +305,8 @@ These @tech{formlet}s are the main combinators for form input.
}
@defproc[(textarea-input [#:rows rows (or/c false/c number?) #f]
[#:cols cols (or/c false/c number?) #f])
[#:cols cols (or/c false/c number?) #f]
[#:attributes attrs (listof (list/c symbol? string?)) empty])
(formlet/c (or/c false/c binding?))]{
This @tech{formlet} renders using an TEXTAREA element with attributes given in the arguments.
}