Hi all
I'm having trouble getting a -validate block working with template::element::create. I know it works with ad_form but the program I'm working with uses template::element::create. Is it possible to pass variables into the expression? It seems that $value is the only variable it can see.
Here's my code:
template::element::create $form_id default_org_contact_rel_p \
-label "Contact Rel P" \
-datatype text \
-widget checkbox \
-options $check_options \
-optional \
-validate {
only_one_allowed
{ db_string get_count $default_org_validation_sql }
"Only 1 relationship permitted"
}
Can anyone help?
thanks
Brian