Describes in general terms how to add Client (Browser) and Server Side validation for
data coming from the Staff Portal. See also Modify Existing Staff Portal Pages
-
Discover what template file in
/usr/local/billmax/uatemplates is being used to display
the page to which validation will be added.
-
While viewing the page view the source of the page.
-
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
-
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.
-
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
- Edit /usr/local/billmax/cfg/cgiaction/account.cat.
- In the section account,cphone, change
constraints:^[^`]*$ to
constraints:^[0-9]{3}[-][0-9]{3}[-][0-9]{4}$
- Execute mkca
-i
account.cat.
This will enforce a 10 digit number of
the form ###-###-####.