Change Label and Help Text of Variable based on value selected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2017 11:08 AM
Is there a way to change the help Text and label of a variable based on something selected in another variable?
I have a catalog form that has a field called Collaboration Tool (Lookup Select Box - another table in SN) and a field called Key (Single Line Text).
If Collaboration Tool = Value Z, Help Text and Label for "Key" field should be ZZZZ.
If Collaboration Tool = Value X, Help Text and Label for "Key" field should be XXXX
Specific help would be appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2017 11:11 PM
Hello Leah,
Instead of changing the Label and Help Text, how is it if you use two variables and display them accordingly using Catalog onChange Client Script based on the value selected in Collaboration Tool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2017 01:10 AM
Hi Leah,
You can change the label of field on the below written onchange client script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
if (newValue=='3') {
var oldLabel = g_form.getLabelOf('comments');
g_form.setLabelOf('comments', 'Customer visible');
}
else
g_form.setLabelOf('comments', 'Additional Comments');
}
In order to change the help text you need DOM manipulation which is not recommended. Instead if you have to do please refer to the below link:
Updating variable help text dynamically?
Regards,
Souren
PS: Hit like, Helpful or Correct if I was able to assist you