1

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.

1
  • Have you looked at removing html tags with jQuery?
    – Anna_MediaGirl
    Aug 13 '13 at 16:41
2

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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