Forum OpenACS Q&A: troubles with validation

Collapse
Posted by Anny Flores on
I need to validate a variable in ad_form, but I'm having troubles with it because the validation must be in an if statement, right now I'm using -extend but it doesn't work.
  I'll apreciate any help
Collapse
Posted by Don Baccus on
Can you explain exactly what you're trying to validate?  Normally validation is done in the validation block in your ad_form declaration.
Collapse
Posted by Anny Flores on
Hi Don,

The code goes like this:

if { *condition* } {
ad_form -extend -name form_name -validate {
  {var_name
  { *condition* }
    "Message"
  }
}

the problem is that even when the condition of the if statement is true, the validation doesnt work.
What I would like to know is if it can be done or I'm doing it
wrong.

          By the way,I saw you a few months ago in        Guatemala, I just want you to know.

Thanks for your help.