javascript - Ripping off HTML tags and considering line breaks in a textarea


I am using CodeIgniter for my own web page and I have several textareas in it. Is there any way that I can prevent HTML tags to be stored in the database? Is there any utility that takes the text out clean?

Also, I do want to display line breaks, so when anyone types anything in the textarea and presses enter, it should produce a line break when displayed later. Should I store the<br> in the database?

I don't know if this can be done with CodeIgniter or any php function or javascript and/or jQuery has to be used, and how to do it.

People are also looking for solutions to the problem: operators - Check if multiple conditions are not true php


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.