[racket] Web input-string with pre-fllled value

From: Nadeem Abdul Hamid (nadeem at acm.org)
Date: Tue Aug 24 14:33:05 EDT 2010

>
> I would like to pre-fill the VAT Rate input-string with a rate (set to 17.5 as a
> default). Is there a way I can do that?
>

You probably have to define your own formlet, e.g.:

(define init-input-string (λ(val)
                                      (to-string
                                       (required
                                        (text-input #:value
(string->bytes/locale
                                                             val))))))

Then you can do something like:

,{(init-input-string "17.5") . => . rate}



>
> Also, is there a way I can give the submit button a label other than "Submit
> Query"?
>

Use a value attribute:

(input [(type "submit") (value "Go!")])


--- nadeem


Posted on the users mailing list.