Click or drag to resize

getField Method

Gets the first PDF form field object in the loaded PdfWebControl document with a given name.

Syntax
JavaScript
function getField(name);

Parameters

name

Type: String

The name of the field object to retrieve.

Return Value

Type: PdfObject Class

Returns the first PdfObject Class instance found. If no field is found, null 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 either: (a) null if no cooresponding field was found or (b) the first PdfObject Class found in this document (starting with the first page). 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 the first form field object with the name "Test Name"
  var field = myApi.getField("Test Name");

  //if found
  if(field)
  {
      //set its name to "New Name"
      field.setProperties( {"name" : "New Name"} );
  }
See Also