DynaPDF.CreateRadioButton
-------------------------

Creates a radio button field.

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

MBS( "DynaPDF.CreateRadioButton"; PDF; Name; ExpValue; Checked; Parent; PosX; PosY; Width; Height ) 

**MBS**( **"DynaPDF.CreateRadioButton";** /\* Creates a radio button field. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Name**; /\* Name of the fielde.g. "IsMale" \*/   
**$ExpValue**; /\* Export value (required)e.g. "IsMale" \*/   
**$Checked**; /\* If 1, the check box appears checked. Else pass 0 for unchecked.e.g. 0 \*/   
**$Parent**; /\* Parent group field if any or -1.e.g. -1 \*/   
**$PosX**; /\* X-Coordinate of the text field.e.g. 100 \*/   
**$PosY**; /\* Y-Coordinate of the text field.e.g. 100 \*/   
**$Width**; /\* Width of the text field.e.g. 100 \*/   
**$Height**) /\* Height of the text field.e.g. 20 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Name | Name of the field | "IsMale" |
| ExpValue | Export value (required) | "IsMale" |
| Checked | If 1, the check box appears checked. Else pass 0 for unchecked. | 0 |
| Parent | Parent group field if any or -1. | -1 |
| PosX | X-Coordinate of the text field. | 100 |
| PosY | Y-Coordinate of the text field. | 100 |
| Width | Width of the text field. | 100 |
| Height | Height of the text field. | 20 |

### Result

Returns handle or error.

### Description

Creates a radio button field.  
A radio button field is a set of related toggle controls (check boxes), at most one of which may be on at any given time; selecting any one of the button automatically deselects all others.  
  
If the coordinate system is bottom-up the point PosX, PosY defines the lower left corner of the first check box that is automatically created by this function. If the coordinate system is top-down it defines the upper left corner.  
  
Like all form fields, the width and height is measured incl. the line width of the border. The size of normal vector graphics is measured without the line width; this must be taken into account when calculating the width or height of a form field. The line width of the border is derived from the current graphics state (see [DynaPDF.SetLineWidth](DynaPDFSetLineWidth.md)), it should be either 0, 1, 2, or 3 units (no border, thin, medium, or thick). The border style can be changed with the functions [DynaPDF.SetBorderStyle](DynaPDFSetBorderStyle.md) or [DynaPDF.SetFieldBorderStyle](DynaPDFSetFieldBorderStyle.md).  
  
This field type supports two additional flags: ffNoToggleToOff and ffRadioIsUnion. The flag ffNoToggleToOff has no more any effect in Adobes Acrobat or Reader. The radio button behaves always as if the flag ffNoToggleToOff is set.  
  
If the flag ffRadioIsUnion is set, and if two or more check boxes contain the same export value, then these check boxes will be selected in unison.  
  
It is not possible to add an action to a radio button field. Actions must be added to the check boxes which are included in the radio button. The handle of the first check box can be calculated by adding 1 to the handle value of the radio button field. For example, if the handle of the radio button is 1, then the handle of the first check box is 2.  
  
If the function succeeds the return value is the handle of the radio button, a value greater or equal zero. If the function fails the return is error message.  
  
See also [DynaPDF.SetCheckBoxChar](DynaPDFSetCheckBoxChar.md), [DynaPDF.SetCheckBoxState](DynaPDFSetCheckBoxState.md) and [DynaPDF.SetFieldHighlightMode](DynaPDFSetFieldHighlightMode.md).  
See also [CreateRadioButton](https://www.monkeybreadsoftware.com/DynaPDF-Manual/CreateRadioButton.shtml) function in DynaPDF manual.

### See also

- [DynaPDF.CreateButton](DynaPDFCreateButton.md)
- [DynaPDF.CreateCheckBox](DynaPDFCreateCheckBox.md)
- [DynaPDF.CreateGoToAction](DynaPDFCreateGoToAction.md)
- [DynaPDF.CreateResetAction](DynaPDFCreateResetAction.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.SetBorderStyle](DynaPDFSetBorderStyle.md)
- [DynaPDF.SetCheckBoxChar](DynaPDFSetCheckBoxChar.md)
- [DynaPDF.SetCheckBoxState](DynaPDFSetCheckBoxState.md)
- [DynaPDF.SetFieldBorderStyle](DynaPDFSetFieldBorderStyle.md)
- [DynaPDF.SetFieldHighlightMode](DynaPDFSetFieldHighlightMode.md)

### Blog Entries

- [MBS Filemaker Plugin, version 4.2pr5](https://www.mbsplugins.de/archive/2014-05-10/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 11st March 2025

  
[DynaPDF.CreateRadialShading](DynaPDFCreateRadialShading.md) - [DynaPDF.CreateResetAction](DynaPDFCreateResetAction.md)

[HTML Version](DynaPDFCreateRadioButton.shtml)