Bug fix in _validateEnum function

I encountered JavaScript errors in jQuery that were triggered by the _validateEnum  function and made my form unresponsive.
Below is a fix that repaired things for me.

![_validateenum_bugfix](https://cloud.githubusercontent.com/assets/9483187/4991103/dfe9278a-698f-11e4-8c9e-65c94cd63ab3.png)