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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TEXTAREA to HTML File Problem

Status
Not open for further replies.

pnjones

Technical User
Dec 1, 2000
25
US
I created a wedding website for my niece with FrontPage 2002, which includes a guest book form with a TEXTAREA field to leave a message for the bride and groom. The form results are stored to an HTML file and also sent to an e-mail address in plain text format. It is working fine except when the user enters a couple of carriage returns to separate paragraphs, or multiple spaces between sentences.

For example if the user submits the message:

Hi! How are you?

I am fine.

It shows up correctly in the e-mail message, but the HTML file is rendered by a browser as:

Hi! How are you? I am fine.

Knowing that HTML does not recognize carriage-return line-feeds or consecutive spaces, I created a JavaScript function to parse and edit the message before it is submitted. Following the example, it converts the string to:

Hi!&ampnbsp;&ampnbsp;How are you?<br><br>I am fine.

Unfortunately, FrontPage appears to convert our example again prior to storing the results to the HTML file, to a string that looks something like this:

Hi!&ampamp;nbsp;&ampamp;nbsp;[/code]How are you?
Code:
&amplt;br&ampgt;&amplt;br&ampgt;I am fine.

Which of course is displayed by the browser as:

        Hi!&ampnbsp;&ampnbsp;How are you?<br><br>I am fine.

So, I am back where I started from.  It sure seems like FrontPage is out to get me!

Does anyone know how to get FrontPage to leave the converted text alone or have it properly convert the text to HTML in the first place?  Any leads would be appreciated.

Paul Jones
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top