- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2021 06:47 AM
Hi All,
I have a requirement to include hyperlink in check box variable. But by default we does not have any "Annotation" tab in check box variable. How do we achieve this by any chance. Please help me to get a solution on the same.
In the highlighted area hyperlink should come named as "Link" example: I Acknowledge Link(https://google.com) the content.
Solved! Go to Solution.
- Labels:
-
Script Debugger
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2021 06:25 AM
You have to do the validation inside the widget only .
You have to use the ng-model for it and then use client script(widget to set the value to some variable in your form)
HTML
<div>
<input type="checkbox" ng-change = 'c.checkboxcheck()'ng-model='data.check'>I Acknowledge <a href="https://www.google.com" target="_blank" rel="noopener">Link Opens in New Tab</a>Test Record <a href="https://www.w3schools.com" target="_blank" rel="noopener">Link Opens</a><br>
</div>
Client Code
//make sure you add $scope to function
var g_form = $scope.page.g_form;
c.checkboxcheck = function(){
g_form.setValue('variable name',c.data.check);
}
Now you can check this in your client script
var costcenter = g_form.getValue('cost_center');
alert(costcenter);
var ack = g_form.getValue('variable name');
alert(ack);
if(costcenter=='d9d0a971c0a80a641c20b13d99a48576' && !ack ){
g_form.addErrorMessage('please enter acknowledgement');
return false;
}
else{
return true;
}
I haven't tested the above but this is the way you have to follow, let me know if you have any questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2021 02:28 AM
Hi Rani, I am in same situation. Can you tell me where we should write client controller exactly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2021 08:04 AM
Hi,
It is not possible out of the box
You can achieve this using UI macro and Widget
refer below link where I have show how to add URL; on similar lines you can implement
Need to implement catalog URL Macro with the help of Jelly script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader