Emulating Radio Buttons
From Scribus Documentation Project
The screenshots from http://wiki.scribus.net/index.php/How_to_simulate_Radio_Buttons_on_PDF_forms need to be redone in PNG format.
Currently, Scribus cannot create real radio buttons in PDF forms, because the PDF specification for creating radio button objects requires a group of items with an identical name. Scribus does not support objects with an identical name.
Fortunately, a group of check boxes, each containing a little JavaScript, can be used to simulate a group of radio buttons.
The Method by Example
Select “Check Box” from the "PDF Fields" drop down list in the toolbar.
In your document, create two or more check boxes and use a text frame to label each with suitable text.
Each check box should also have a suitable name to reflect the purpose.
In our example we will have three check boxes called “Yes”, “No”, “Maybe” and three text frames containing “YES”, “NO”, “MAYBE”.
Be careful with the names when you are using JavaScript as Adobe Reader is case sensitive.
You should end up with something like this on your page.
Right-click with your mouse on the “Yes” Check Box (Blue Square). From the context menu select "PDF Options > Field Properties".
In the dialog, go to "Action Tab" and choose "JavaScript", then use the default Mouse Up event. Click on the "Edit" button and type the following code:
//this.getField("Yes").value = "Off"
this.getField("No").value = "Off"
this.getField("Maybe").value = "Off"
Note that the initial "//" means that the first line is commented out, as it is not required for this field. Doing it this way makes it easy to Copy and Paste the complete code to all the check boxes and reduces typing errors.
Click on "Save" and "Exit". The dialog should now look like this:
For the “No” check box, repeat the process with:
this.getField("Yes").value = "Off"
//this.getField("No").value = "Off"
this.getField("Maybe").value = "Off"
and then with the “Maybe” check box:
this.getField("Yes").value = "Off"
this.getField("No").value = "Off"
//this.getField("Maybe").value = "Off"
Save your Scribus document as a PDF file and view the PDF file using Adobe Reader. Now you should see the following fields that work like radio buttons.
If you want to use traditional "round" radio button, you need to create an illusion.
For your check boxes use the following settings:
- "Appearance" tab:
- Color: None
- Width: None
- Style: Solid
- "Options" Tab:
- Check Style: Circle
Now use the Scribus "Shape" tool to draw a circle around the check box. The resulting PDF should look like this:
