How to change dynamically the help text of a variable on a portal form?

Smith Johnson
Tera Guru

Hello,

 

is there any way to change dynamically the help text of a variable on a catalog item on portal???

For example, based on the "Activity" field, I would like to change dynamically the help text on the "Additional Information" field.

find_real_file.png

Thank you for your assistance,

Smith.

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

Unfortunately that is not possible. All you can do is use showFieldMsg() instead in a Client script.

View solution in original post

14 REPLIES 14

Hi @Chris Hatch ,

 

Your code is working when there is no instruction text on form load.

When I select value as 'new_role' after form load - Screenshot 1

When I select value as 'remove_role' after form load - Screenshot 2

But the issue is:

After selecting 'new_role', if I change selection to 'remove_role', then it is still like Screenshot 1.

Meaning - it is not changing to help text of 'remove_role'.

 

My code is given below:

if (newValue == 'change_role' || newValue == 'new_role') {
        var infoField = g_form.getField("additional_information");
        infoField.expand_help = true;
        infoField.instructions = "<p>The technical names of the Roles can be written here.</p>";
    } else {
		var infoField = g_form.getField("additional_information");
        infoField.expand_help = true;
        infoField.instructions = "<p>Please indicate the date from when the roles can be removed.</p>";
    }

 Screenshot 1:

subhadeep1618_0-1693883109101.png

 

Screenshot 2:

subhadeep1618_1-1693883157742.png

 

 


Please mark this post as a solution and also as helpful, if this resolves your issue or query.

Thanks,
Subhadeep Ghosh.

@subhadeep1618 this is not working on sc_task please help

hi @Chris Hatch not working in sc_task please help

 

Alp Utku
Mega Sage

AYou can also create couple label fields to be shown by selection from Activity field.

 

You could control the visibility of the label fields by UI Policy

Community Alums
Not applicable

I think there's a bug in the Community because I couldn't find @Chris Hatch 's original post.

Worked perfectly for me on a Tokyo Patch 5, so a big thank you and summary for my own benefit.

Catalog Client Script: 

var f = g_form.getValue('FIELD_NAME');
if (f) {
  f.help_text = 'OVERWRITE_MSG';
}