Please login to access all of the features of the Community Site.


    Entry Form Buttons

    Buttons on entry forms have several capabilities. Learning to extend them can help you build even more power into your workflows.

    Button Types

    You'll notice that Rock ships with several different button types. These provide the basic styles for the buttons. You can define new types under Admin Tools > General Settings > Defined Types > Button HTML. When you define a button, you must provide mark-up for both a normal webpage and an HTML email.

    Cancel Buttons

    All buttons on a form will cause 'validation' to occur. This is a fancy term for checking that all the required fields are provided for. Sometimes though you want to provide a cancel button. Having to fill out all of the required fields just to cancel can be annoying. To keep the validation from occurring, use the Cancel button type or create your own button type that skips validation.

    A button type's markup lives in its Button HTML field and usually includes onclick="{{ ButtonClick }}". When the form displays, Rock fills in the {{ ButtonClick }} merge field with code that tells the form to check required fields. Put return true; there instead and Rock treats the button like Cancel, so the check never runs. To build one:

    1. Go to Admin Tools > General Settings > Defined Types > Button HTML and add a new button type. Copy the markup from an existing type to get started.
    2. In the Button HTML field, change onclick="{{ ButtonClick }}" to onclick="return true;". Keep the double quotes and the semicolon. Make sure {{ ButtonClick }} no longer appears anywhere in the field.
    3. Select Save.
    4. On your entry form, choose the new button type for the action that shouldn't validate.