Isolated all the register validation into a JavaScript file