Convert textfield to be used in html class or id?
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.