Finished javascript validation