Page 1 of 1

Hide/Show extra fields based on Dropdown selection

Posted: 2019-10-29 21:03
by aarlauskas
Hi, not sure if this was answered, but I have seen some other people asking similar question.. I really need a solution for my scenario:
When creating a record, this needs to be flexible in a way that I could add one or multiple items on the same record, but keep the fields hidden if they are not required for this moment. So basically, let say I'm attending a site to swap part on machine. I then need three fields to fill-in for the replacement of this part in Appgini (Machine Nr, Part Model and Part Serial Nr). But then I go elsewhere and I need to swap three parts on three machines. So I would like to have an option to un-hide additional fields by selecting the number of the machines from a drop-down menu. Lets say I select '3 Terminals' from drop-down list and this gives me additional fields for these part swaps to be recorded. Can someone help with this? I can pay symbolic price for the coffee (sorry I'm not earning anything from this, just trying to make my day easier... ) Thank You.

Re: Hide/Show extra fields based on Dropdown selection

Posted: 2019-10-29 21:40
by pbottcher
Hi,

you may try

Code: Select all

$j('#FIELD-container').on('change', function(e){
  if(e.added.text == "3 Terminals") {
    $j('YOURFIELDLIST').show();
  }
})
where FIELD need to be recplace with the fieldname of the dropdown and YOURFIELDLIST is the list of field that you want to unhide.
something like
'#field1, #field2, #field3'