- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 08:57 AM
Hi Team,
I have checkbox with Help text attached to it but whenever i check it the help text get disappear but as per my requirement i have to keep it fixed.
I have attached the help text by using catalog client script onLoad :
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 09:08 AM
@Abhi_007 : Please try changing your script to OnChange by removing isLoading and newValue check, and below is a sample reference to the code that worked in my PDI.
function onChange(control, oldValue, newValue, isLoading) {
g_form.showFieldMsg('test', 'Test Message', 'info');
}
Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 09:29 AM - edited 12-22-2023 09:31 AM
I tried below script on my PDI & it works. Make sure you are creating only onChange client script from Scratch, don't use the onLoad one. Deactivate the old-one & create new one making sure all highlighted values are selected properly -
Make sure to update the variable name in form & in script. Also update catalog-item name as well.
If it solves your issue, please ACCEPT it else please mark helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 09:01 AM
Can you please post a picture as how does it look right now from UI perspective?
My understanding is that if you want to keep showing the FieldMessage even when checkbox is checked, instead of using onLoad client script, you should write an onChange client script on that field.
I hope you already know that onChange client script runs - onLoad + onChange of field both. That way you can try sticking the fieldMessage in both the scenarios.
Do mark this response as ACCEPTED if it solves your problem or as HELPFUL if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 09:08 AM
@Abhi_007 : Please try changing your script to OnChange by removing isLoading and newValue check, and below is a sample reference to the code that worked in my PDI.
function onChange(control, oldValue, newValue, isLoading) {
g_form.showFieldMsg('test', 'Test Message', 'info');
}
Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 09:19 AM
Hi as per the screen shot the help text should be mandatory even after checking the checkbox. @Sainath N i tried the same but it is not working. @H S B should i write OnChange and Onload both for the help text to get intact after checking the checkbox?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 09:24 AM
You only need one onChange client script actually. Just remove the IF section completely which contains isLoading part in it as mentioned by @Sainath N. After that whatever you write in this onChange client script, it will run both onLoad & onChange of this checkbox as well.
I hope it helps.