Hide section of Form.

Hi Sandra,
I have used the method you describe in another thread and it worked beautifully for a raw.

" - Rather than deleting (or un-requiring) a field, you can replace it with a hidden field that fills something like ‘N/A’ into the field in the background. This could let you remove and tweak the front-end of the application without breaking the back-end.

  • For example, if I wanted to remove the following required field:

$row = $form->addRow();
$row->addLabel(‘countryOfBirth’, __(‘Country of Birth’));
$row->addSelectCountry(‘countryOfBirth’)->isRequired();
I could try replacing it with a hidden field of the same name and a generic value:
$form->addHiddenValue(‘countryOfBirth’, ‘N/A’); "

Now I would like to hide a section of the form, like “Employment”.

Is that possible?
thanks

I can comment it out the code with /* … */ .

Hi cmb, it looks like the fields are not required, so yes, in that case you should be able to just comment them out and the form should still submit without an issue.