---
title: "setFieldName(_:)"
framework: pdfkit
role: symbol
role_heading: Instance Method
path: "pdfkit/pdfannotationbuttonwidget/setfieldname(_:)"
---

# setFieldName(_:)

Sets the internal name of a field (used for reset-form actions).

## Declaration

```swift
func setFieldName(_ name: String!)
```

## Parameters

- `name`: The internal name of a field. This is an optional value.

## See Also

### Related Documentation

- [PDFAnnotationButtonWidget](pdfkit/pdfannotationbuttonwidget.md)

### Managing Control State Values and Form Fields

- [onStateValue()](pdfkit/pdfannotationbuttonwidget/onstatevalue().md)
- [setOnStateValue(_:)](pdfkit/pdfannotationbuttonwidget/setonstatevalue(_:).md)
- [fieldName()](pdfkit/pdfannotationbuttonwidget/fieldname().md)
