Hello,
I'd like to ask a question ..
How do i prevent people posting HTML codes in an textarea ?
thanks it really will helps me alot
Hello,
I'd like to ask a question ..
How do i prevent people posting HTML codes in an textarea ?
thanks it really will helps me alot
Last edited by egturnkey; 04-13-2009 at 05:56 PM. Reason: Problem has been resolved, thanks
You could use JavaScript like this:
This won't work if JavaScript is turned off so you need to do server side checking as well.HTML Code:<textarea onkeyup="javascript:this.value=this.value.replace(/[<,>]/g,'');"></textarea>
Good luck!
egturnkey (04-13-2009)
thanks very much , it now works perfect.
As Snookerman said, it won't work if javascript is turned off. I suggest using PHP's htmlentities().
Jeremy | jfein.net
You're welcome, glad to help!
Good luck with your site!
Bookmarks