- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2023 04:21 AM
Let me know if this would be better in another forum:
I've had a look at several tutorials but they seem to be more about Categories and Sub-Categories and I suspect this is fairly straightforward once you know how:
I would like to create a new mandatory field for Agents on the incident form that presents 2 options and then a new drop down list appears for each option, depending on which option is chosen.
I'm fine creating new string fields but trying to work out how to make them appear dependent on a choice list.
e.g.
1. Choose from a new field - option A or Option B
2. Choose option A - new list appears below with option A choices - 1,2,3
3. Choose option B - new list appears below with option B choices - 1,2,3
The result will be an incident form recording failure demand and value demand and the type , separate from category and subcategory. Any advice is much appreciated
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2023 05:42 AM - edited ‎01-20-2023 05:50 AM
Hi @stephenjsmith ,
It is not possible by form design. If we don't want to write the script then we can create 3 Ui polices to achieve this.
From Filter navigation go to system ui> select ui policies> click new
1:
2:
3:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2023 04:49 AM - edited ‎01-20-2023 04:50 AM
Hi @stephenjsmith ,
You need to create 3 choice fields on the form and next you need to write onload client script and onchange client script.
onload client script:
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.setDisplay('u_option_a', false);
g_form.setDisplay('u_option_b', false);
}
Onchange Client script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var a = g_form.getValue('u_field_1');
alert(a);
if (a == '1') {
g_form.setDisplay('u_option_a', true);
g_form.setDisplay('u_option_b', false);
} else {
g_form.setDisplay('u_option_a', false);
g_form.setDisplay('u_option_b', true);
}
}
Mark the solution as helpful and correct if it solves your issue.
Regards,
Kalyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 03:15 AM - edited ‎01-09-2024 03:15 AM
Not able to Create dropdown list on incident form using client script. can anyone please help me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 03:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2023 05:21 AM
Thank you for sharing this solution. I was hoping I could do it without coding in the Form Design interface, I it will be a bit more complex than I thought 🙂