Skip to main content
edited tags
Link
Mark Cassidy
  • 25.4k
  • 7
  • 59
  • 117
Source Link
Ken McAndrew
  • 5.1k
  • 3
  • 20
  • 55

Strip HTML when pasting into single-line text field

If someone copies HTML from another site (like a title) and pastes it into a single-line text field, is there any way to automatically strip the HTML out? I know with rich text fields there are paste options to do this if you want, but with single-line text it sometimes throws one of those "an error occurred" messages in experience editor (logs come back with "After parsing a value an unexpected character was encountered: O") and sometimes it just shows the raw HTML instead. Thanks.