rrawson Honored Contributor.
Honored Contributor.

Return a list of the fields in a form

Is there a simple way to iterate through all the fields in a form?

rrawson's Profile: https://forums.netiq.com/member.php?userid=403
View this thread: https://forums.netiq.com/showthread.php?t=53882

Labels (1)
1 Reply
charakopidis Absent Member.
Absent Member.

Re: Return a list of the fields in a form

you could use JavaScript or JQuery to do this.

if you want to get all fields, you can try to get them, by selecting
them with the id. They always starts with _

for example:

var fieldValues = $('form table tr').find('[id^="_"]');

If you want only the Label of the fields try this one:

var fieldLabels= $('form table tr').find('[id$="_lbl"]');
$.each( fieldLabels, function( i, value ) {

charakopidis's Profile: https://forums.netiq.com/member.php?userid=829
View this thread: https://forums.netiq.com/showthread.php?t=53882

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.