/    Sign up×
Community /Pin to ProfileBookmark

Formatting cgi submitted text

Is there any way to format the text from a multi line TextField?

ie wrap the text the same way it appears on the actual form, before submission?

TIA

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@tomhartlandOct 27.2004 — Assuming you're talking about server-side programming, it depends on what technology you're using (ASP, ASP.NET, PHP, etc).

The normal way is to replace the carriage return with <br> tags.

(As a side note, you need to be careful about writing to screen the contents of a text edit - a malicious user could place any HTML/javascript/etc code on your page. Imagine somebody putting a redirect command on a message board.)
Copy linkTweet thisAlerts:
@trunkieauthorOct 27.2004 — Sorry I should have been more explicit. I have a form submitted by cgi. The text wraps fine in the TextField but when I receive the email the formatting isn't kept. How can I maintain this formatting?

For example in an address box the user would enter 3 or 4 lines. When the form is submitted the address loses the formatting and is displayed on 1 line.

Many thanks
Copy linkTweet thisAlerts:
@tomhartlandOct 27.2004 — Sorry I'm really having trouble working out exactly what you mean.

I'm either missing something, or I'm being really thick - trust me, option 2 is a high possibility ?

If you are receiving the form into your cgi (which ever technology it is), then you must be sending the e-mail yourself. Can't you just format the value that is provided from the textarea?
Copy linkTweet thisAlerts:
@ray326Oct 27.2004 — If you know the column width of the widget then you can do your own line wrap based on that.
×

Success!

Help @trunkie spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...