Home
The Toolkit for Online Communities
15900 Community Members, 1 member online, 2307 visitors today
Log In Register

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

OpenACS Home : Forums : OpenACS Development : Re: template::form::set_error not working : One Message

+
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
    }
}

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