Commit fade03d2 authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-5214: fixing visibility and required field states

parent b4bfecdc
......@@ -26,16 +26,6 @@ function uw_ct_opportunities_form_alter(array &$form, FormStateInterface $form_s
}
}
// Set the states for employment type.
$form['field_uw_opportunity_employment']['#states'] = [
'visible' => [
'select[name="field_uw_opportunity_type"]' => ['value' => $tid],
],
'required' => [
'select[name="field_uw_opportunity_type"]' => ['value' => $tid],
],
];
// Set the states for the pay rate.
$form['field_uw_opportunity_pay_rate']['#states'] = [
'visible' => [
......@@ -48,6 +38,10 @@ function uw_ct_opportunities_form_alter(array &$form, FormStateInterface $form_s
'visible' => [
'select[name="field_uw_opportunity_type"]' => ['value' => $tid],
],
];
// Set the required.
$form['field_uw_opportunity_pay_type']['widget']['#states'] = [
'required' => [
'select[name="field_uw_opportunity_type"]' => ['value' => $tid],
],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment