Skip to content

Commit 0472ccb

Browse files
Merge branch 'main' into my-first-contribution
2 parents 1bb9aed + fded483 commit 0472ccb

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This script is a Client Script (onLoad) for ServiceNow which retrieves all field names present on the current form and displays them in an alert message.
2+
3+
Example: Hi Sai, please find the elements of the form short_description, description, number, etc.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
function onLoad() {
2+
//Type appropriate comment here, and begin script below
3+
var arr = [];
4+
for (var i = 0; i < g_form.elements.length; i++) {
5+
arr.push(g_form.elements[i].fieldName);
6+
}
7+
alert("Hi Sai, please find the form elements: " + arr.join(","));
8+
}

0 commit comments

Comments
 (0)