[racket] textarea-input keys

From: Shogo Yamazaki (moquo2.718 at gmail.com)
Date: Mon Jun 27 12:06:45 EDT 2011

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?


Shogo Yamazaki
moquo2.718 at gmail.com

(define (my-textarea-input
         #:rows [rows #f]
         #:cols [cols #f]
         #:attributes [attrs empty]
         #:initial-value [iniv ""])
   (lambda (n)
     (list 'textarea
           (list* (list 'name n)
                   (filter list?
                           (list (and rows (list 'rows (number->string rows)))
                                 (and cols (list 'cols (number->string cols)))))

Posted on the users mailing list.