[Html-widget] formfu - What's the best way to add dynamic defaults?

Carl Franks fireartist at gmail.com
Thu Mar 29 10:12:26 GMT 2007


On 29/03/07, Daisuke Maki <daisuke at endeworks.jp> wrote:
> This is what I want to do:
>    - When the user hits this URL for the first time (i.e., no
> submission, etc), I want to display todays date.
>
>    - When the user submits the form, I want to use whatever the user
> provided, except for invalid dates -- in which case today's date is
> displayed.

Which scenario do you want?

A) If the user enters an invalid date, you want that to be considered
an error, and so the form has to be redisplayed to the user with the
date replaced by the current date, and an appropriate error message.

B) If the user enters an invalid date, the input value is changed to
the current date, but it's not considered an error - so the form will
only be redisplayed if there are any other errors - and if there are
no other errors, you'll use the current date value as if the user
entered it.

C) Other.

Carl



More information about the Html-widget mailing list