18.02.2015 Views

5ml User's Guide

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 3: <strong>5ml</strong> Tutorial<br />

4. Add a Radio Button group:<br />

a. Drag the Radio Button widget from the Widgets pane to the Canvas.<br />

b. Resize and position the Radio Button element.<br />

c. In the Properties pane to the right, in the Value field, enter a value for the new Radio Button element. For<br />

example, enter 1.<br />

d. In the Text field, enter a label for the Radio Button element. For example, enter TV.<br />

e. Drag an additional two Radio Button widgets from the Widgets pane to the Canvas. For each Radio Button<br />

element, enter a unique Value and Text label. For example, 2 and Radio, and 3 and Other.<br />

Note: Within a group of Radio Button elements, each Radio Button element's Value field must contain a<br />

unique value.<br />

f. Edit the second and third Radio Button element's ID field to match the first Radio Button element's ID value.<br />

Note: To create a group of Radio Button elements, each Radio Button element's ID field must contain the<br />

exact same value.<br />

g. Now that each Radio Button element has the same ID and each has a unique Value, you can select which<br />

Radio Button element will be set as the default Radio Button element. On the Canvas select the default<br />

Radio Button element, and in the Properties pane, select the Checked check box.<br />

Figure 3-48: Adding JavaScript code to create the Custom Function sendForm<br />

5. Add a submit button and JavaScript code:<br />

In order to gather the user entered data, you need to write custom JavaScript code to capture the data from the<br />

specific fields in your form. You also need to provide a way to execute the JavaScript code. To do this you can add<br />

a Button element to the page and on the Button element's Behavior tab, you can select an event and action. For<br />

example, on clicking (onclick) the button the JavaScript code (Custom Function) executes.<br />

- 72 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!