Welcome Guest, Not a member yet? Register   Sign In
Highlight bad words in textarea in php
#3

(04-07-2017, 05:23 AM)PaulD Wrote: 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.


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!
Reply


Messages In This Thread
RE: Highlight bad words in textarea in php - by wolfgang1983 - 04-07-2017, 09:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB