Fixed the javascript validation to work on Firefox.