Add Staff Portal Validation

Describes in general terms how to add Client (Browser) and Server Side validation for data coming from the Staff Portal. See also Modify the Staff Portal

  1. Discover what template file in /usr/local/billmax/uatemplates is being used to display the page to which validation will be added.
    1. While viewing the page view the source of the page.
    2. Look for the string name="FORM" as part of an HTML hidden field. In general the value of the hidden field will reference the template file name. There may be multiples entries so several template file many need to be examined to determine the correct one
  2. Client (Browser) Validation may be added to the template file. In general this is done by adding JavaScript to the localVerifyData JavaScript function in the template. If one does not exist in the template, it can be added.
  3. Server Side Validation may be accomplished by adding to the constraint entry for a data element in the corresponding file in /usr/local/billmax/cfg/cgiaction. The constraint entry may be either a Regular Expression or a macro from the List regexmacros.

Add Server Side validation to the field Phone Number on the Account page

  1. Edit /usr/local/billmax/cfg/cgiaction/account.cat.
  2. In the section account,cphone, change constraints:^[^`]*$ to constraints:^[0-9]{3}[-][0-9]{3}[-][0-9]{4}$
  3. Execute mkca -i account.cat.

    This will enforce a 10 digit number of the form ###-###-####.