How to minimize the gap between two fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 11:59 PM
Hello community,
I have a requirement that when the CAB required is checked the CAB date and CAB recommendation field should be visible. I have achieved the functionality using UI policy. However when the form load initially there is a gap(marked with red square) between two fields(CAB required and Outage required). Can you please suggest the code how to minimize the gap between two fields.
When unchecked:
When checked:
Code in UI policy:
Thanks & Regards,
Jagan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 12:09 AM
Hi @JaganN971616731 ,
I tried your problem in my PDI and I created onChange client script on active field (checkbox field as you showed in example). Please refer code
alert("Active = " + newValue);
if (newValue == false || newValue == 'false') {
g_form.setVisible('u_test', false);
g_form.setVisible('activity_due', false);
}else{
g_form.setVisible('u_test', true);
g_form.setVisible('activity_due', true);
}
Here's the Result
When I did active false
Test and activity due field is removed
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 12:26 AM
Hi @Community Alums
When you make Active as false there is a gap between incident state and project time. How to minimize that gap?
Thanks and Regards
Jagan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 12:32 AM - edited 04-19-2024 12:33 AM
Hi @JaganN971616731 ,
Instead of setVisible you can use setDisplay method
alert("Active = " + newValue);
if (newValue == false || newValue == 'false') {
g_form.setDisplay('u_test', false);
g_form.setDisplay('activity_due', false);
}else{
g_form.setDisplay('u_test', true);
g_form.setDisplay('activity_due', true);
}
You can see now the gap is gone
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak