validate registration javaScript