Hide/Show Fields based on select box
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2024 08:31 PM
Hello,
can someone please post what to do to hide or show the following fields based on 'technical governance intake path'
If NAS is selected it should show
- validated cmdb accuracy (not sure why i cant edit this field)
- rationale
- technical architecture design
HIDE
- conceptual design
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2024 09:02 PM
Hello @karlab ,
You can achieve this using the Catalog client Script, you can reference the below script and adjust variables accordingly,
Create an onChange Client Script:
(function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var intakePath = g_form.getValue('technical_governance_intake_path');
// Show/Hide logic based on the 'NAS' selection
if (intakePath === 'NAS') {
g_form.setVisible('validated_cmdb_accuracy', true);
g_form.setVisible('rationale', true);
g_form.setVisible('technical_architecture_design', true);
g_form.setVisible('conceptual_design', false);
} else { //you can adjust the else condition according to your need
// Hide fields when intake path is not 'NAS'
g_form.setVisible('validated_cmdb_accuracy', false);
g_form.setVisible('rationale', false);
g_form.setVisible('technical_architecture_design', false);
g_form.setVisible('conceptual_design', true);
}
});
Please mark help and accept the solution if that helps.
Thanks,
Pradeep
Regards,
Pradeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 09:27 AM
Not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 09:29 AM
This is what I have on my script