Shortcodes for Use in the Form Template

This is an update on the shortcodes available for customizing your RSVP form. These are not normally used in the body of the post as they are below but in the form template you can establish on a global basis in the settings screen and customize on a per event basis.

Updates: See also this update, detailing the more visual form generator now available.)

As of version 3.7, you can specify that a field should be repeated on the guest section of the form by adding the guestfield=”1″ attribute.

[rsvpfield radio=”meal” sep=” ” options=”Steak,Chicken,Vegetarian” checked=”Steak” guestfield=”1″ ]

Option to customize the RSVP form for a specific post.
Option to customize the RSVP form for a specific post.

The default form is laid out in a table, but you’re welcome to use another formatting scheme that fits with the theme for your site.

I’ve gotten some requests to support additional common HTML codes, so checkboxes and radio buttons have been added.

Sample Custom Fields

For example if I want to add the following input fields …

Nickname for badge:

I will volunteer to help with setup and cleanup.

Food choice:

Drink choice:
beer wine soda

… I would specify them in the editor like this (bold added for emphasis).

Here are the controls and how they work.

Text Field

Shortcode:

[rsvpfield textfield="text-test" size="60"]

HTML:
<input  class="text-test" type="text" name="profile[text-test]" id="text-test"  size="60"  value=""  />
Profile:
array (
  'nickname' => '',
  'volunteer' => '',
  'food' => '',
  'drink' => '',
  'text-test' => '',
)
Display:

Text Field, Required

Shortcode:

[rsvpfield textfield="text-test" size="60" required="1"]

HTML:
<span class="required"><input  class="text-test" type="text" name="profile[text-test]" id="text-test"  size="60"  value=""  /></span>
Profile:
array (
  'nickname' => '',
  'volunteer' => '',
  'food' => '',
  'drink' => '',
  'text-test' => '',
)
Display:

Select Field

Shortcode:

[rsvpfield selectfield="select-test" options="one,two,three,four"]

HTML:
<span  class="select-test"><select class="select-test" name="profile[select-test]" id="select-test" >
<option value="one" >one</option>
<option value="two" >two</option>
<option value="three" >three</option>
<option value="four" >four</option>
</select></span>
Profile:
array (
  'nickname' => '',
  'volunteer' => '',
  'food' => '',
  'drink' => '',
  'text-test' => '',
  'select-test' => '',
)
Display:

Select Field with Default Selection

Shortcode:

[rsvpfield selectfield="select-test" options="one,two,three,four" selected="three"]

HTML:
<span  class="select-test"><select class="select-test" name="profile[select-test]" id="select-test" >
<option value="one" >one</option>
<option value="two" >two</option>
<option value="three"  selected="selected" >three</option>
<option value="four" >four</option>
</select></span>
Profile:
array (
  'nickname' => '',
  'volunteer' => '',
  'food' => '',
  'drink' => '',
  'text-test' => '',
  'select-test' => '',
)
Display:

Checkbox, checked by default

Shortcode:

[rsvpfield checkbox="checkboxtest" value="1" checked="1"]

HTML:
<input class="checkboxtest" type="checkbox" name="profile[checkboxtest]" id="checkboxtest" value="1"  checked="checked" />
Profile:
array (
  'nickname' => '',
  'volunteer' => '',
  'food' => '',
  'drink' => '',
  'text-test' => '',
  'select-test' => '',
  'checkboxtest' => '',
)
Display:

Radio buttons, separated by line break (default)

Shortcode:

[rsvpfield radio="radiotest" options="one,two,three,four" checked="two"]

HTML:
<span  class="radiotest"><input class="radiotest" type="radio" name="profile[radiotest]" id="radiotestone" class="radiotest"  value="one"  /> one</span>  <span  class="radiotest"><input class="radiotest" type="radio" name="profile[radiotest]" id="radiotesttwo" class="radiotest"  value="two"  /> two</span>  <span  class="radiotest"><input class="radiotest" type="radio" name="profile[radiotest]" id="radiotestthree" class="radiotest"  value="three"  /> three</span>  <span  class="radiotest"><input class="radiotest" type="radio" name="profile[radiotest]" id="radiotestfour" class="radiotest"  value="four"  /> four</span> 
Profile:
array (
  'nickname' => '',
  'volunteer' => '',
  'food' => '',
  'drink' => '',
  'text-test' => '',
  'select-test' => '',
  'checkboxtest' => '',
  'radiotest' => '',
)
Display:

one two three four

Radio buttons, separated by a space

Shortcode:

[rsvpfield radio="radiotest2" options="one,two,three,four" checked="two" sep=" "]

HTML:
<span  class="radiotest2"><input class="radiotest2" type="radio" name="profile[radiotest2]" id="radiotest2one" class="radiotest2"  value="one"  /> one</span>  <span  class="radiotest2"><input class="radiotest2" type="radio" name="profile[radiotest2]" id="radiotest2two" class="radiotest2"  value="two"  /> two</span>  <span  class="radiotest2"><input class="radiotest2" type="radio" name="profile[radiotest2]" id="radiotest2three" class="radiotest2"  value="three"  /> three</span>  <span  class="radiotest2"><input class="radiotest2" type="radio" name="profile[radiotest2]" id="radiotest2four" class="radiotest2"  value="four"  /> four</span> 
Profile:
array (
  'nickname' => '',
  'volunteer' => '',
  'food' => '',
  'drink' => '',
  'text-test' => '',
  'select-test' => '',
  'checkboxtest' => '',
  'radiotest' => '',
  'radiotest2' => '',
)
Display:

one two three four