Click or drag to resize

isFormField Method

Gets a value indicating whether the object represented by this PdfObject instance is a form field.

Syntax
JavaScript
function isFormField();

Parameters

None

Return Value

Type: Boolean

Returns true if this object is a form field; otherwise false.

Remarks

This method should be used to test if an unknown object is a form field. If more specific information about the type of this object is needed, use the getType Method.

Examples
The following example uses the ObjectEventArgs Class to handle the "objectAdded" event of the PdfWebControlApi Class.
JavaScript
//declare event handler function (which accepts an object of type ObjectSelectedEventArgs as an argument)
function objectSelectedHandler(evt)
{
    //if this is not a form field
    if( !evt.obj.isFormField() )
    {
        //move object to top to page
        evt.obj.setProperties({"top" : 0});
    }
}

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

//attach event handler to objectSelected event
myApi.addEventListener("objectSelected", objectAddedHandler);
See Also