- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2025 04:42 AM
I need to write an onload client Script on a HTML type variable called 'what would you like to do '
and the message is : -
Which department ?
Has been identified and secured?
If so, which FY and/or future periods available?
i've tried it in the below way
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2025 05:06 AM
@Trupti Krishnam Create one variable of type "Rich Text Label" and place it after your HTML variable as below..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2025 07:50 AM - edited 08-14-2025 07:50 AM
Ok then asa workaround create one more HTML variable and put the message there. Then make the field read-only.
Use one on load client script to hide the label of the new created HTML field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2025 05:10 AM
It worked for me in PDI:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2025 04:55 AM
@Trupti Krishnam , Try this code it will work -
function onLoad() {
var message = "Which department?<br>" +
"Has been identified and secured?<br>" +
"If so, which FY and/or future periods available?";
g_form.setValue('u_v_todo', message);
}
I tried it on PDI and it work!
Shashank Jain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2025 04:56 AM
i should not set the msg it should appear as an info msg right below the html variable type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2025 05:25 AM
@Trupti Krishnam , Try this
Just update your variable name instead of 'u_test_script'
function onLoad() {
var htmlVar = g_form.getControl('u_test_script');
if (!htmlVar) return; // Safety check
// Create the info message element
var msgContainer = document.createElement('div');
msgContainer.className = 'fieldmsg notification notification-info';
msgContainer.style.marginTop = '5px';
msgContainer.innerHTML =
'Which department?<br>' +
'Has been identified and secured?<br>' +
'If so, which FY and/or future periods available?';
// Insert right after the HTML variable
htmlVar.parentNode.appendChild(msgContainer);
}
Refer the below screenshot, Is this what you trying to do?
Shashank Jain