DynaPDF.SetFieldIndex
---------------------

Sets the tab order of interactive form fields.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [4.0](newinversion40.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.SetFieldIndex"; PDF; Field; Index ) 

**MBS**( **"DynaPDF.SetFieldIndex";** /\* Sets the tab order of interactive form fields. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Field**; /\* The field index or field name.e.g. "FirstName" \*/   
**$Index**) /\* The field index. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Field | The field index or field name. | "FirstName" |
| Index | The field index. |  |

### Result

Returns OK or error.

### Description

Sets the tab order of interactive form fields.   
All fields, independently whether they are created with DynaPDF or imported from external documents, holds in internal index which can be used to reorder or sort the fields with this index.  
The start index of a new field is not zero, it is 1000 instead. This makes it easier to set a field in front of all other fields without changing all field indices. However, changing a field index changes not the tab order directly, the fields of a page must be sorted before the page will be closed with the function DynaPDF.SortFieldByIndex.  
The tab order of interactive form fields must be set for each page separately.  
See also [SetFieldIndex](https://www.monkeybreadsoftware.com/DynaPDF-Manual/SetFieldIndex.shtml) function in DynaPDF manual.

### See also

- [DynaPDF.GetFieldIndex](DynaPDFGetFieldIndex.md)
- [DynaPDF.GetGlyphIndex](DynaPDFGetGlyphIndex.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.SetFieldBBox](DynaPDFSetFieldBBox.md)
- [DynaPDF.SetFieldColor](DynaPDFSetFieldColor.md)
- [DynaPDF.SetFieldDate](DynaPDFSetFieldDate.md)
- [DynaPDF.SetFieldFlags](DynaPDFSetFieldFlags.md)
- [DynaPDF.SetFieldFont](DynaPDFSetFieldFont.md)
- [DynaPDF.SetFieldFontEx](DynaPDFSetFieldFontEx.md)
- [DynaPDF.SetFieldName](DynaPDFSetFieldName.md)

This function checks for a license.

Created 18th August 2014 , last changed 17th July 2022

  
[DynaPDF.SetFieldHighlightMode](DynaPDFSetFieldHighlightMode.md) - [DynaPDF.SetFieldMapName](DynaPDFSetFieldMapName.md)

[HTML Version](DynaPDFSetFieldIndex.shtml)