This code hides the mem_children field when 'MARRIED' status is selected. The label is still visible.
What needs to be done is:
1) When the form loads, the mem_anniversarydate and mem_children along with the respective labels should be hidden. They should only be visible when the option in mem_maritalstatus is selected as 'MARRIED' and they should be set as required field.
2) The second question regarding custom fields in Add/Edit forms is still unanswered.
I need to show/hide fields depending on the selection of a previous value …
Example: Table: Member mem_id, mem_name mem_gender mem_maritalstatus mem_anniversarydate mem_address mem_areaid
When selecting "Married" in mem_maritalstatus, it should show mem_anniversarydate (as required field) and if in mem_maritalstatus "Unmarried" is selected, it should hide mem_anniversarydate. If the status is edited from "Married" to "Unmarried" the mem_anniversarydate should be cleared.
Secondly, I want to show data from other table in Add/Edit mode. Custom fields are disabled in Add/Edit mode.
Eg: Table: Area area_id area_name area_zip area_state
Table: Member mem_id, mem_name mem_gender mem_maritalstatus mem_anniversarydate mem_address mem_areaid
I'm storing the mem_areaid from area table and need to show the corresponding city and zip of the area as well in the Member table when adding/editing data.