Using Form Controls

To simplify the process of designing forms we've created a set of Lava shortcodes for common types of form fields.

To create a simple textbox in Rock you'd normally have to provide the following markup:

<div class="form-group rock-text-box required">
    <label class="control-label" for="rc-ab5633b7-2a1f-41b6-b346-cb48679ae68d">Last Name</label>
    <div class="control-wrapper">
	<input name="lastname" type="text" id="rc-ab5633b7-2a1f-41b6-b346-cb48679ae68d" class="form-control  " value="Decker" required="" hx-validate="true">
    </div>
</div>

Instead you can use the provided shortcode. This makes it as easy as:

{[ textbox name:'lastname' label:'Last Name' value:'Decker' ]}

This example, though basic, demonstrates significant efficiency gains. When applied to more intricate features, such as a campus picker, the benefits and time savings become even more pronounced.

{[ campuspicker name:'campus' label:'Primary Campus' value:'1'  ]}

To see all of the controls we provide look under the 'Helix' category on your server's Lava Shortcode page (Admin Tools > CMS Configuration > Lava Shortcodes).

We strongly advise against modifying these shortcodes, as we plan to enhance them with additional features, which would overwrite your changes.

Last updated