TS 6.01 on Solaris
I would like to implement workflow datacapture validation which makes a field required based on the value of another form field. I believe this is possible using the valid_input element on the TAG_info field, but cannot get it working.
Here is what I have so far:
my($radio_default_yes_html) = "<input type='radio' value='yes'checked>yes</input>" .
"<input type='radio' value='no'>no</input>";
TAG_info(
iw_agency_pre_rvw_req =>
[html => $radio_default_yes_html,
label => "Include agency pre-review?:",
is_required => 'true',
error_msg => 'Please identify agency pre-review requirements',
],
iw_agency_rvw_team =>
[ html => $agency_rvw_team_html,
label => "Select an agency review team:",
is_required => 'false',
valid_input => 'field_validator($_)',
error_msg => 'Please select an agency review team',
],
)
sub field_validator{
my ($field_value) =
@_;
... Logic here should be if (value of iw_agency_pre_rvw_req is 'yes') then make iw_agency_rvw_team a required field, otherwise ok to leave iw_agency_rvw_team blank
}