Source

webwork / src / java / template / simple / checkbox.vm

#*
  -- checkbox.vm
  --
  -- Required Parameters:
  --   * label       - The description that will be used to identfy the control
  --   * name        - The name of the attribute to put and pull the result from
  --                   Equates to the NAME parameter of the HTML INPUT tag
  --   * fieldValue  - The value displayed by the control.  Equates to the value
  --                   of the HTML INPUT tag
  --
  -- Optional Parameters:
  --   * disabled        - DISABLED parameter of the HTML INPUT tag
  --   * tabindex        - tabindex parameter of the HTML INPUT tag
  --   * onchange        - onkeyup parameter of the HTML INPUT tag
*#
<input type="checkbox" name="$!webwork.htmlEncode($parameters.name)" value="$!webwork.htmlEncode($parameters.fieldValue)"
#if ($parameters.nameValue)        checked="true"                                           #end
#if ($parameters.disabled == true) disabled="disabled"                                      #end
#if ($parameters.tabindex)         tabindex="$!webwork.htmlEncode($parameters.tabindex)"    #end
#if ($parameters.onchange)         onchange="$!webwork.htmlEncode($parameters.onchange)"    #end
#if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"                #end
#if ($parameters.cssClass)         class="$!webwork.htmlEncode($parameters.cssClass)"       #end
#if ($parameters.cssStyle)         style="$!webwork.htmlEncode($parameters.cssStyle)"       #end
/>