Help text mandatory even after checking the checkbox

Abhi_007
Kilo Guru

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 :

g_form.showFieldMsg 
 
Please help me how to keep the help text fixed even after checking the checkbox.
2 ACCEPTED SOLUTIONS

Sainath N
Mega Sage
Mega Sage

@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.

View solution in original post

H S B
Giga Guru

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 -

HSB_0-1703266055266.png

 

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.

View solution in original post

8 REPLIES 8

H S B
Giga Guru

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.

Sainath N
Mega Sage
Mega Sage

@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.

Abhi_007
Kilo Guru

Abhi_007_0-1703265344478.png

@Sainath N @H S B  

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?

 

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.