OptionBox

Top  Previous  Next

OptionBox is a Process Field and it should be placed into a ProcessRecord Element. It encloses two or more <input type="radio" /> elements and a <input type="hidden" /> and it behaves as a single input field.

  <tr mo:type="ProcessRecord"> 
    <td>
      <span mo:type="OptionBox" mo:field="true" mo:name="GENDER" mo:needsInit="true"
           mo:iValue="{GENDER}" 
           mo:props="warnColor:'#FFCC99', nonBlank:true, 
                     valHandler:MyValHandler, valErrorHandler:MyErrorHandler">
        <input type="radio" name="__t_GENDER_{position()}" value="M" 
               onclick="PMgr.selectOption(this)" /> Male <br/>
        <input type="radio" name="__t_GENDER_{position()}" value="F" 
               onclick="PMgr.selectOption(this)" /> Female
        <input type="hidden" name="pf_GENDER"/>
      </span>
     </td>
  </tr>

The names of the nested  <input type="radio" /> elements must be identical so that only one of them can be checked at a time.

See OptionBox function class in  MoreMotion Face API.

warnColor property

The color code given with this property is used to highlight the background of the element when a validation failure occurs. 

 

See Validation Properties

 

Required Javascript File

In addition to the standard ones, this element requires that OptionBox.js Javascript file is linked to the page in the HEAD section of the HTML document as follows.

  <head> 
    <script type="text/javascript" src="moremotion/face/Process/Process.js"></script>
    <script type="text/javascript" src="moremotion/face/_resources/<language-code>/Process.js"></script>
    <script type="text/javascript" src="moremotion/face/Process/OptionBox.js"></script>
  </head>