Forum OpenACS Q&A: Re: Behaviour of ad_form's {value "..."} form element parameter

Why don't you set foo in the page contract or in the new_request block like this:

ad_form -form {
foo:text
} -new_request {
set foo "bar"
}

I'm not using a key in my form so -new_request doesn't work.

ad_page_contract {} {
    {foo "bar"}
}

doesn't fill the form field, unless i also include a {value $foo}, in which
case an empty string is valid. I could however manually check for that - this works:

ad_page_contract {} {
    {foo "bar"}
}

ad_form -form {
    {foo:text {value $foo}}
} -validate {
    {foo {![string equal $foo ""]} "foo is a required field"}
} ...