- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 06:31 AM - edited 06-07-2024 07:01 AM
Hi All,
I have a requirement that when i select the dropdown option "service required" is only "GitHub Co-Pilot (cost : 19 €/month)"
also based on the dropdown i have configured another dropdown "Do you already have a license"
When selected "NO" an error message has to be presented saying me to select the option "GitHub Enterprise (cost : 14 €/month)" as shown in the message below.
The error message should be presented till i select "GitHub Enterprise (cost : 14 €/month)" along with "GitHub Co-Pilot (cost : 19 €/month)"
How to achieve this?
How do achieve this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 06:37 AM
@phr Instead of wrapping your function inside an onLoad function. You should put it inside
function onCondition() {
var sn = g_form.getValue("do_you_already_have_visual_studio_license");
if (sn=="No") {
g_form.addErrorMessage("Please add GitHub Enterprise license to the service required field in this form");
}
}
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 06:40 AM
It looks like you updated the template and it is no longer calling the correct function. You can see in the example below in a fresh UI policy that it is calling onCondition(), yours looks like the template for an onLoad client script. Change your function back to match the screenshot and see if that resolves your issue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 06:37 AM
@phr Instead of wrapping your function inside an onLoad function. You should put it inside
function onCondition() {
var sn = g_form.getValue("do_you_already_have_visual_studio_license");
if (sn=="No") {
g_form.addErrorMessage("Please add GitHub Enterprise license to the service required field in this form");
}
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 07:07 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 07:20 AM
@phr Just responded to you via a direct message. Please check your inbox.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 06:40 AM
It looks like you updated the template and it is no longer calling the correct function. You can see in the example below in a fresh UI policy that it is calling onCondition(), yours looks like the template for an onLoad client script. Change your function back to match the screenshot and see if that resolves your issue.