开发者

Removing special strings from textarea/content area using jquery or javascript

开发者 https://www.devze.com 2023-02-28 22:10 出处:网络
I\'m doing a website in php. I just got a requirement to remove some special strings like phone number, email address, facebook address etc from a textarea which users enter.

I'm doing a website in php. I just got a requirement to remove some special strings like phone number, email address, facebook address etc from a textarea which users enter.

I want to identify such things from the content and show an alert message to user and remove that contents from the data user entered. i want to do this in jqu开发者_C百科ery or javascript.

Any one have an idea, please share it with me, any help will be much appreciated!

Thanks in Advance, Tibin Mathew


Wherever you want to do it client side or server side you need a regular expression for each kind (phone number, email address etc) and replace text with an emprty string.

Javascript string.replace

PHP preg_replace

0

精彩评论

暂无评论...
验证码 换一张
取 消