How to set string field value based on choice field type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2023 09:52 PM
Hi,
Field 1(Issue) Choice Field: Mobile Issue, CPU Issue.
Field 2: based on choice selection in filed 1, fields 2 value should populate.
EX: in Field 1 I have selected Mobile Issue, in Field 2 it should populate "Describe the issue"
in Field 1 I have selected CPU Issue, in Field 2 it should populate "CPU not working".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2023 10:14 PM
Hello,
Using OnChange client script you can set the values of field2. Write code like below.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (newValue == "Mobile Issue")
{
g_form.setValue("field2 name", "Describe the issue");
}
else if (newValue == "CPU not working")
{
g_form.setValue("field2 name", "CPU not working");
}
Please mark my answer as helpful/correct if it helps you.
Regards,
Namrata