Skip to main content

Show Posts

This section allows you to view all Show Posts made by this member. Note that you can only see Show Posts made in areas you currently have access to.

Messages - bhavin

1
General Discussion / Re: Show/hide field depending on value of other field
Your short answer was tried and tested but it does not seem to work as required.

$('#ctrl-mem_maritalstatus').on('change', function(){
   
   if($(this).val() == 'MARRIED') {
            $('#ctrl-mem_anniversarydate').show();
            $('#ctrl-mem_children').show();
        }
        else {
            $('#ctrl-mem_anniversarydate').hide();
            $('#ctrl-mem_children').hide();
        }
   
});

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.

Please help.
2
General Discussion / Show/hide field depending on value of other field
Hello everyone,

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.

How can this be done?

Thank you.