To fix Issue #3: Remove SQL from HTML and replace formScan() JS function with individual functions to build up the bits of the SQL query. Makes for better design, and easier to minify in future. Plus, it removes the dependency on form/element order in HTML.