Hide fields based off selected from a dropdown. Cases

Hi


I have the need to hide a number of fields based off what is selected from a drop down list on a field in the same screen.


i've used a bit of Java that works in the Onchange script:

if(Values('case_productarea')=='QC29')

{

hidden = true;

}

else

{

hidden = false;

}

This works but only once the record is saved, the fields i've put the script on disappear but they dont disappear once the needed dropdown value is selected.

Anyhelp with this Java is appreciated.

Thanks

Parents
  • 0

    Try something like this in the OnChange script of case_productarea:

    if (this.value != 'QC29')

    {

    document.getElementById('case_NameOfFieldToHideGoesHere').style.visibility='Hidden'

    document.getElementById('_Captcase_NameOfFieldToHideGoesHere').style.visibility='Hidden'

    }

    else

    {

    document.getElementById('case_NameOfFieldToHideGoesHere').style.visibility='Visible'

    document.getElementById('_Captcase_NameOfFieldToHideGoesHere').style.visibility='Visible'

    }

    This script should dynamically hide a different field when you change the value in case_productarea.

    This is valid for v6.2, and should work through versions up to v7.1. v7.2 has the new client-side API, which has some different ways of dealing with hiding objects.

    To keep them hidden after you've saved the record, put the code that you posted above in the CreateScript of the fields you want to keep hidden.

    - Matt -

Reply
  • 0

    Try something like this in the OnChange script of case_productarea:

    if (this.value != 'QC29')

    {

    document.getElementById('case_NameOfFieldToHideGoesHere').style.visibility='Hidden'

    document.getElementById('_Captcase_NameOfFieldToHideGoesHere').style.visibility='Hidden'

    }

    else

    {

    document.getElementById('case_NameOfFieldToHideGoesHere').style.visibility='Visible'

    document.getElementById('_Captcase_NameOfFieldToHideGoesHere').style.visibility='Visible'

    }

    This script should dynamically hide a different field when you change the value in case_productarea.

    This is valid for v6.2, and should work through versions up to v7.1. v7.2 has the new client-side API, which has some different ways of dealing with hiding objects.

    To keep them hidden after you've saved the record, put the code that you posted above in the CreateScript of the fields you want to keep hidden.

    - Matt -

Children
No Data