Skip to content

Commit 6632941

Browse files
authored
Create getFormElements.js
This code helps in retrieving all the form fields by getting all the elements on the form
1 parent c4bf84d commit 6632941

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
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)