AnsweredAssumed Answered

Help on Conditional Select Field Options

Question asked by diegojacob on Sep 17, 2018
Latest reply on Sep 18, 2018 by Grant Bruneau

Hi guys!

 

Is it possible to condition the ca_reportQuery based on the selection of ca_fdGetSelectedOptionValues to display another select field?

 

I need to display all municipalities of the Brazilian states based on the pre-selection of this state.

 

I created the report for each state and its municipalities, however I'm not sure how to condition this report and use it in a new ca_fdGetSelectedOptionValues.

 

Has anyone ever had to do this?   

 

I use the javascript below to show and hide some fields, however I'm not sure how to condition the use for new selects ca_fdGetSelectedOptionValues.

 

{
     showLabel: function () {
          var estado = ca_fdGetSelectedOptionValues(ca_fd.formId, 'ca_sdm_attr_z_str_estado');

          if (estado == 'Distrito Federal') {
               ca_fdHideField(ca_fd.formId, 'predio_descentralizadas');
               ca_fdHideField(ca_fd.formId, 'sala_descent');
               ca_fdShowField(ca_fd.formId, 'predio');
               ca_fdShowField(ca_fd.formId, 'sala');
          }
     }
}

 

Many thanks!

Outcomes