Click or drag to resize

getFields Method

Gets an array of PDF form field objects in the loaded PdfWebControl document with a given name (or all).

Syntax
JavaScript
function getFields(name);

Parameters

name

Type: String

The name of the field object(s) to retrieve or null to return all fields.

Return Value

Type: Array of PdfObject Class

Returns an array of PdfObject Class instances. If no fields are found, an empty array will be returned.

Remarks

A single name may coorespond to several pdf form field objects in a RAD PDF document. Because of this, this function always returns an array containing either: (a) 0 elements if no cooresponding fields exist or (b) 1 or more elements, each of which is a PdfObject Class. All pages of the document will be loaded to preform this lookup. The name parameter is case-sensitive.

Examples
JavaScript
var myApi = new PdfWebControlApi("PdfWebControl1"); // where "PdfWebControl1" is the ID (ClientID) assigned to the PdfWebControl instance

  //get all form field objects with the name "Test Name"
  var fields = myApi.getFields("Test Name");

  //iterate through all form fields returned
  for(var i = 0; i < fields.length; i++)
  {
      //set its name to "New Name"
      fields[i].setProperties( {"name" : "New Name"} );
  }
See Also
This website uses cookies to identify your session and other necessary functions. By using this website, you are agreeing to our Terms of Use and Privacy Policy (updated April 26 2021).
Learn About Cookies
Got it!