<<BACK    HOME    CNCPT    TTRL    JSsf.net/projects/validateformjs[ U | s | m | ? ]
   rqd dec eml int len MCR bss trm sifAll Concepts
   frm txt pwd txa rdo sl1 chk slmAll Object Types

validate_form.js
Concept: sMsgMCRange

Ensures the number of options selected in a multiple-choice element are within a desired range. Summary
sMsgMCRange All Attributes
txt pwd txa rdo sl1 chk slm Interactive Example Code
Higher  [  trm rqd len dec eml int sif MCR bss  ]  Lower Precedence


[TOP]   sMsgMCRange attribute: sMsgMCRange        
Value Purpose The error message presented to the user when the number of options selected is out of range.
Value Rules Must be a string at least one character in length.
Object Compatibility checkbox,  select-multiple
Attribute Compatibility sMsgRequired
Special Strings
  • ~RANGE_MIN~: Translated to iMCMin
  • ~RANGE_MAX~: Translated to iMCMax
  • ~OPTS_TOTAL~: Translated to the total number of choices in the element.
  • ~OPTS_CHOSEN~: Translated to the actual number of selected choices.
Sub-Range
Name Purpose Rules
iMCMin The minimum allowable selections When provided, must be an integer between 0 and [total number of options]. At least one of iMCMin and iMCMax must be provided. When iMCMax is also provided, this must be less-than-or-equal-to it.
iMCMax The maximum allowable selections When provided, must be an integer between 0 and [total number of options]. When iMCMin is also provided, this must be greater-than-or-equal-to it.









TOP     rqd dec eml int len MCR bss trm sif
<<BACK  txt pwd txa rdo sl1 CHK slm
Object Type Concept
checkbox sMsgMCRange

VF-Config Snippet f_orm['movies_seen.sMsgMCRange'] = 'Must choose between ~RANGE_MIN~ and ~RANGE_MAX~ movies,inclusive. Total movies: ~OPTS_TOTAL~. Chosen movies: ~OPTS_CHOSEN~.';
   f_orm['movies_seen.iMCMin'] = 2;
   f_orm['movies_seen.iMCMax'] = 3;
Example Element <INPUT TYPE="checkbox" NAME="movies_seen" VALUE="bttf"> Back To the Future
<INPUT TYPE="checkbox" NAME="movies_seen" VALUE="tmm"> The Muppet Movie
<INPUT TYPE="checkbox" NAME="movies_seen" VALUE="mcv"> My Cousin Vinnie

The form Change the vf-configuration
What movies have you seen?
      Back To the Future
      The Muppet Movie
      My Cousin Vinnie
sMsgRequired
   iMCMin
      
      
   iMCMax
      
      
[[     [ CIBC CRSH ]   DBG     ]]



TOP     rqd dec eml int len MCR bss trm sif
<<BACK  txt pwd txa rdo sl1 chk SLM
Object Type Concept
select-multiple sMsgMCRange

VF-Config Snippet f_orm.foods_eaten.sMsgMCRange = 'Must choose between ~RANGE_MIN~ and ~RANGE_MAX~ foods,inclusive. Total foods: ~OPTS_TOTAL~. Chosen foods: ~OPTS_CHOSEN~.';
   f_orm.foods_eaten.iMCMin = 2;
   f_orm.foods_eaten.iMCMax = 3;
Example Element <SELECT NAME="foods_eaten" SIZE="3" MULTIPLE>
   <OPTION VALUE="aldos_pizza">Pizza from Aldo's Pizzarama</OPTION>
   <OPTION VALUE="ritas_lemon">Lemon water-ice from Rita's</OPTION>
   <OPTION VALUE="green_beans">Steamed green beans with a splash of lemon</OPTION>
</SELECT>

The form Change the vf-configuration
What foods have you eaten?
     
sMsgRequired
   iMCMin
      
      
   iMCMax
      
      
[[     [ CIBC CRSH ]   DBG     ]]



























SourceForge.net Logo

Copyright (C) 2003-2005, Jeff Epstein.   All rights reserved.