Tidied up Client Javascript and form