I'm working on an EE powered website which also serves data to a mobile app. I'm trying to make a safecracker form, but one of the fields cannot have HTML code in it or the app breaks. How do I stop people from entering HTML? Here's the field's line in the safecracker form:

<input type="text" name="snippet" id="snippet" value="{snippet}">

At the moment I think I need to use htmlspecialchars, but I have no idea how to implement it into safecracker. I'm also assuming that it might be easier to apply htmlspecialchars to the output, but unfortunately I do not have access to the apps source code.

  • Have you looked at removing html tags with jQuery?
    – Anna_MediaGirl
    Aug 13, 2013 at 16:41

1 Answer 1


I think, you need to look into that channel preferences under "Channel Posting Preferences". You can see "Default HTML formatting in channel entries" and set it to "Convert HTML into character entities".

I hope, it would work for you.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.