Highlight bad words in textarea in php |
I have this function below which checks for bad words in callback.
PHP Code: public function wordcheck() { On my function ask is there away that it can highlight bad word in my textarea? there is this http://garysieling.github.io/jquery-highlighttextarea/ but it is for javascript/jquery I would like to know if one for php/codeigniter available. PHP Code: public function ask() {
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
Hi,
You are going to have to do it with javascript as you cannot add markup within a text area without it becoming part of the text itself. The example library you linked to does not work on my browser. An interesting example approach to this is here: https://codepen.io/lonekorean/pen/gaLEMR You may be better changing the UI so that the user sees the block of text with words highlighted that are bad in a normal HTML panel, with the text area below. A little bit like how CI forum, when previewing a post, has the preview above and the text area below again. Best wishes, Paul.
(04-07-2017, 05:23 AM)PaulD Wrote: Hi, Thanks for the reply PaulD I will look into it over weekend.
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
|
Welcome Guest, Not a member yet? Register Sign In |