Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with removing multiple nbsp; from textarea on submit

Status
Not open for further replies.

garethtnash

Programmer
Jul 8, 2008
4
Hi All,

I've got a site with a form on that allows users to enter information and submit it, the form sends the information to a stored procedure that html encodes it and stores it on an ms sql database, the web page is written in asp vbscript.

The problem that I am having is that users are pasting information from Word or other document formats, and where the document format is either an ordered or unordered list generating multiple nbsp; spaces. or instance something written in wor that looks like this -

"• To hold a Degree with a significant "

is being submitted as -

"·         To hold a Degree"

Now it looks ok on the database in that it looks like -

"• To hold a Degree"

but when displayed on a html page gives this -

"•aU"

Now I'm guessing the problem here id the multiple &nbsp:

So I was wondering whether there is a way to look for instances of more than one &nbsp: concurrently and change them so there is only one?

So I would be really grateful for your help?

Thank you
 
Hi

Like this ?
Code:
"·         To hold a Degree".replace(/( ){2,}/g,'$1')
Anyway, would be better to verify and correct this on server side.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top