Only allow given profile field types; Javascript function also works in RSpec