Implemented a simple isValidCharacter function. It probably doesn't work in IE 7.