added js validation rather than HTML5 as not working correctly