Fix for bug 37134 - Resolve issue in JavaScript validation when the prototype library - based on patch from Philippe Mouawad