Hi.
I'm now reading article about using formlets in
'Continue: Web Applications in Racket' and trying to use formlets.
It's very exciting!

There is a #:attributes key with text-input, therefore
I can use HTML5 attributes with text-boxes.
On the other hand, textarea-input has only #:rows and #:cols keys,
so I defined my-textarea-input below.

I wonder why it doesn't support #:attributes by default.
Or is there any other smart way?

Thanks.

Shogo Yamazaki
moquo2....@gmail.com


(define (my-textarea-input
         #:rows [rows #f]
         #:cols [cols #f]
         #:attributes [attrs empty]
         #:initial-value [iniv ""])
  (make-input
   (lambda (n)
     (list 'textarea
           (list* (list 'name n)
                  (append
                   (filter list?
                           (list (and rows (list 'rows (number->string rows)))
                                 (and cols (list 'cols (number->string cols)))))
                   attrs))
           iniv))))
_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Reply via email to