101-Form Validation

The RDM sites have used several methods of carrying out form validation over the years, but only a couple are based at the browser, relying instead on sending a form to the server, checking the information supplied and returning the whole form if corrections are needed. This can be a little tedious where several fields need corrections, so a standard browser based first stage to at least check all the fields required have been filled in is a good starting point. The Bitweaver framework allows the addition of layers on top of the basic display framework, and while Bootstrap3 allows some of the basic validation checks that the html5 standard has introduced, it can be enhanced with additional javascript checks. FormValidator has been adopted as this secondary layer as it is designed to enhance both Bootstrap and other display frameworks and can easily be extended. The problem with many of these libraries is that they are internationally based, and do not support some of the UK specific checks as well as the internationally accepted standards. So further additional checks are often needed.

Address lookup and bank details validation are two areas which need access to current valid data over a checking that a postcode or bank sort-code are in a valid format.

Address information from a postcode can be processed at two levels, and our system currently has a postcode database that provides the common data relating to the postcode, and simply requires the addition of a house name or number. Address data is stored simply using a postcode and house ID. Nowadays however most sites provide a list of house ID's when a postcode is entered. This works from the Royal Mail Postal Address File (PAF) which is a service that Royal Mail charge for although if a site is only using a small number of lookups a day this can be free. Royal Mail claim copyright over the basic postcode data as well, but while an initial download of postcodes with addresses may be convenient from them, most of the actual data is available free under the governments open access licences. A second unrelated property register also exists and which we pay for in council tax, but which also then charges for access. This is the National Land and Property Gazetteer which is now accessed via geoplace  and hopefully this will become freely available over time. The Bitweaver framework has modules to handle both the LLPG (Local Land and Property Gazetteer) and LSG (Local Street Gazetter) data for our council clients which they are required to maintain and forward to the national copies. The major difference between the Postal Address File and the National Land and Property Gazetteer is that 'land' element. The NLPG assigns a UPRN reference to every unique parcel of land or structure, the large majority of which Royal Mail do not deliver to. It also uses the correct physical location details while a postcode may use a postally significant alternative.

Just as the basis of postal/property information is chargable, so is access to the full bank account details. Extended Industry Sort Code Directory (EISCD) provides a directory of sort codes but in addition it can also validate the account numbers within each sort code. As with postcode lookup, there are a number of services that allow a limited number of free lookups each day. The £2016 a year charge for direct access is a little out of the price range of the sort of sites we support, but a service like BankAccountChecker allows a small number of searches each day which validates the numbers, and also identifies if an account is usable for Fastpay, CHAPS, and Direct Debit transactions. This is the first stage to setting up regular payments such as Direct Debit subscriptions, or payroll transactions. Bank Account Services is our crib sheet on some of the options on available for both validating account numbers, and using them to create a payroll run or manage Direct Debit agreements.

Credit cards one would think are just an alternative bank account, but in fact they are a completely different system. Similar services are available for validating card details, and the FormValidator will populate the card type from the card number, but currently we prefer to use Paypal to handle this somewhat more complex area. Adding the direct handling of credit cards is something that will be addressed where the volume could result in savings over what charges Paypal take on a transaction.

Building a form on a web page requires a number of elements, some of which are managed directly by the browser, and some of which require additional JavaScript elements to implement. Older browsers such as IE6 are no longer supported, and the basic HTML5 elements are required as a basis for the current framework. Bitweaver does support JavaScript to emulate html5 on the older browsers, but this can conflict with those elements that FormValidator is extending so a line has to be drawn somewhere. Most modern devices are now supported by suitable browsers, although it is not uncommon to find IE6 STILL in use. Some of our council sites have not had the necessary funding to complete upgrades from the perfectly functional systems they currently use.