How to change field name?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2019 01:21 AM
Hi,
I have a field with 3 choices and 6 more fileds and if i select first choice 4 fields should be visible with some name the field name should be changed and if i select second choice and only 2 fileds should be visible with name changing.How can i change the field name for the choices i select
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2019 02:59 AM
Hello ,
You can have a look at below docs that will help you.
OR
Make use of below script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var field1 = g_form.getValue('name of field 1');
g_form.addInfoMessage(loggedInUser.u_user_category);
if(field1 =='choice 1'){
g_form.removeOption('field 2','values 1');
g_form.removeOption('field 2','values 2');
}else if(field1 =='choice 2'){
g_form.removeOption('field 2','values 1');
g_form.removeOption('field 2','values 2');
}
}
Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2019 06:27 AM
are you able to achieve this?
Thanks,
Abhishek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2019 08:13 AM
Hi prathyusha,
You will need to create an on change client script for the initial field with the three choices. From there, you can use g_from.setVisible() to control what fields are seen and g_form.setLabelOf() to change the label that appears for the visible fields.
If you are showing the same fields and just making it look like the fields change because the label changes, that will work. Otherwise, you just need to have all the fields on the form and turn them on/off as needed.
The only other alternative is to define a set of generic fields on your form and populate them when the value of the 3 choices field changes. Then you'll need an on submit client script or a before insert/update business rule to decide what goes where into the table.
Hope that helps.
:{)
Helpful and Correct tags are appreciated and help others to find information faster
:{)
Helpful and Correct tags are appreciated and help others to find information faster