Glimmr Form Fields

version 1/101201 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter: A field's accepted input

    Section: Standard input

    The "standard input" of a field is the characters that it is capable of displaying. By default, a field can display any character available in the font used for the rendered string (e.g., Glimmr Image Font). However, we can restrict that input by defining the "accepted standard input" of the field. The accepted standard input is a list of numbers corresponding to the characters that can be entered into the field. For example, to restrict a field to only accepting a plus or a minus sign, we would declare the accepted standard input accordingly:

        My form field is an input field. The accepted standard input is {43, 45}.

    The 43 and 45 are the character codes for "+" and "-" respectively.

    Note that, if we declare the accepted standard input for a field, the characters in the list will be the *only* ones that the field will accept and attempt to display.