By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,695 Members | 1,638 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,695 IT Pros & Developers. It's quick & easy.

Do not support HTML in textarea

P: n/a
Hi,
I have a textarea and I would like to prevent users from inserting
HTML tags. Only plain text is supported.
Which client-side js regular expression is best for this?
Thanks, Gabi

Oct 24 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Oct 24, 11:59 am, Gabriella <frohlin...@yahoo.comwrote:
I have a textarea and I would like to prevent users from
inserting HTML tags. Only plain text is supported.
Which client-side js regular expression is best for this?
None. Client side JS can't prevent them from entering anything.

And are you certain they won't want to insert things that look like
tags but are actually text?

Just do the usual replacement of &->&amp;, >->&gt;, <->&lt; server
side and HTML injection will be defeated.

--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/

Oct 24 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.