- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2025 10:08 AM
html
<div>
<h1>Check Your Attendance Details</h1>
<input type="text" name="name" placeholder="Enter Your Name" ng-mode="c.data.name">
<input type="text" name="roll_no" placeholder="Enter Roll No" ng-model="c.data.roll_no">
<button ng-click="vis()">Submit</button>
<p>{{data.name}}</p>
<div>
client script
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2025 11:21 AM
Hi there,
Try below:
HTML:
<div>
<h1>Check Your Attendance Details</h1>
<input type="text" name="name" placeholder="Enter Your Name" ng-model="c.data.name">
<input type="text" name="roll_no" placeholder="Enter Roll No" ng-model="c.data.roll_no">
<button ng-click="c.vis()">Submit</button>
<p>{{data.name}}</p>
<div>
Client Script:
api.controller=function($scope) {
/* widget controller */
var c = this;
c.vis = function(){
c.server.update();
alert(c.data.name);
}
};
Server Script:
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
data.name = "";
data.roll_no = "";
if(input){
data.name = input.name;
gs.addInfoMessage(data.name);
}
})();
In HTML your ng-model has a typo & you should not write ng-onClick like that. It should be c.functionName()
To learn more about Widget scripting please refer here.
If my answer helps then please mark it Helpful and Accept this solution.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2025 11:23 AM
You can also refer to this ServiceNow DOC for learning.
