Client script question to show/hide field
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2012 07:41 AM
I have a field that needs to be shown on an sc_task form. The field should show based on wf_activity and a value in a catalog variable. The script looks like this:
function onLoad() { //Show the equipment to be installed field and make it read only var wf = g_form.getDisplayBox('wf_activity').value; var existHW = g_form.getValue('variables.existing_hardware_hw'); if((wf.indexOf('validate the device')<0) || (wf.indexOf('Installing hardware') ==0)){ if(existHW == 'No'){ g_form.setVisible('u_equipment_to_be_installed', true); g_form.setReadonly('u_equipment_to_be_installed', true); }else{ g_form.setVisible('u_equipment_to_be_installed', false); } } }
This works if the workflow activity is "Installing hardware", but it doesn't work if the workflow activity is "Install/validate the device". What am I missing? Do I need to have 2 separate conditions instead of one with an 'OR'?
Thanks
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2012 08:10 AM
use
g_form.setDisplay('u_equipment_to_be_installed', true);
instead of
g_form.setVisible('u_equipment_to_be_installed', true);
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2012 08:21 AM
Thank you.