Convert textfield to be used in html class or id? Does anyone know if it is possible to apply a Twig filter or use escaping to convert a Craft textfield into a html class/id safe string?
You can do this with the Luke Holder's Inflect plugin. Which method to use would depend on how you want the resulting text to look. I'd use {{ myTextField|slugify }} to get a string that looks like this "this-is-my-class", since I only use lowercase and hyphenate class/id names.