Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 12:34 PM
I created a Client Side script to hide a section called Database if the field u_database is set to false, but it is not working. Can someone tell me what I am doing wrong please.
function onLoad() {
var databaseFieldValue = gForm.getValue('u_database');
if (databaseFieldValue === 'false') {
gForm.setSectionDisplay('Database_section', false);
} else {
gForm.setSectionDisplay('Database_section', true);
}
}
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 01:22 PM
Hello @RobertPC ,
Please try this:
function onLoad() {
g_form.setSectionDisplay('Database_section', g_form.getValue('u_database') != 'false');
}
Regards,
Robert
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 01:03 PM
You've got the wrong syntax for g_form. Try this:
function onLoad() {
var databaseFieldValue = gForm.getValue('u_database');
if (databaseFieldValue === 'false') {
g_form.setSectionDisplay('Database_section', false);
} else {
g_form.setSectionDisplay('Database_section', true);
}
}
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 01:22 PM
Hello @RobertPC ,
Please try this:
function onLoad() {
g_form.setSectionDisplay('Database_section', g_form.getValue('u_database') != 'false');
}
Regards,
Robert