[racket] formlet checkbox behaves differently from others
Here is my code:
#lang web-server/insta
(require web-server/formlets)
(define (start request)
(define answer (get-answer "Formlet"))
(response/xexpr
`(html (head (title "formlet"))
(body "Answer: " ,(format "~a" answer)))))
(define date-formlet
(formlet
(div "Month:" ,{input-int . => . month}
"Day:" ,{input-int . => . day})
(list month day)))
(define travel-formlet
(formlet
(div "Name:" ,(input-string . => . name)
(div "Depart:" ,{date-formlet . => . depart}
"Return:" ,{date-formlet . => . return})
(div "Car:" ,((select-input (list "No" "Avis" "Budget" "Hertz"))
. => . car))
(div "Hotel:" ,((checkbox "hotel" #f)
. => . hotel)))
(list name depart return car hotel)))
(define my-formlet
travel-formlet)
(define (get-answer label)
(formlet-process my-formlet
(send/suspend
(λ (k-url)
(response/xexpr
`(html (head (title ,label))
(body
(form ([action ,k-url])
,@(formlet-display my-formlet)
(input ([type "submit"])) ))))))))
I fill in the form and then I get the following:
Answer: (jon do (7 4) (7 21) Avis #(struct:binding:form input_6 hotel))
I sorta expected to see "hotel" here but I get the struct instead. Why is
this so?
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140614/abb27d16/attachment.html>