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).

function getFields(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.


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.

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