Forum OpenACS Development: Re: template::form::set_error not working

Collapse
Posted by Dafydd Crosby on
You need to add a break statement to stop the rest of the form from going.

Revised:
} -on_submit {
    if {[lsearch {2 4 5} $organization_type] ne -1 && $states eq ""} {
        template::form::set_error "area" "states" "Required"
        break
    }
}

Collapse
Posted by Ryan Gallimore on
Put your validation in a -validate block. template::form::set_error is then called implicitly.