[racket] formlets and validation

From: Eric Tanter (etanter at dcc.uchile.cl)
Date: Tue Mar 29 22:22:49 EDT 2011

Hi,

I'm exploring formlets (enjoying them for the most part!), and I'm wondering what is the best way to handle input validation. Following the tutorial/guide on formlets results in the web app throwing exceptions whenever formlet-process encounters improper bindings.
(eg. self-contract violation: expected <integer?>, given: #f
  contract on input-int from ...)

However, those are not really helpful for the user. 
I'm wondering:
a- is there a way to specify some validation to be done on the client side?
if not:
b- is there a best practice to expose users to their malformed input in a precise manner? (ie. which input field was incorrectly filled)

Thanks!

-- Éric





Posted on the users mailing list.