/    Sign up×
Community /Pin to ProfileBookmark

Carieage return in TextArea

Is there a way to put a carieage return in textarea? In PHP, I want to echo a cariage return in a TextArea box. Any help is appreciated!

ljCharlie

to post a comment
PHP

9 Comments(s)

Copy linkTweet thisAlerts:
@pyroOct 24.2003 — Using n should work (if you use double quotes for the echo):

[code=php]<?PHP
echo "<textarea cols="25" rows="5">nntest</textarea>";
?>[/code]
Copy linkTweet thisAlerts:
@ljcharlieauthorOct 24.2003 — Thankyou very much for your help. I'll give that a try.

ljCharlie
Copy linkTweet thisAlerts:
@pyroOct 24.2003 — Sure thing... ?
Copy linkTweet thisAlerts:
@ljcharlieauthorOct 24.2003 — Sorry to bother you again, but I received an error. This is my code.

[COLOR=red]<?PHP[/COLOR]

$photoOrderd = [COLOR=red]<?"Photos you ordered are:nn"[/COLOR];

if ($txtChkBox1 <> ""){

$photoOrderd += .$txtChkBox1."n";

}

[COLOR=red]?>[/COLOR]

The error I received is:

[COLOR=red]Parse error: parse error in line 167[/COLOR] which is this line: [COLOR=blue]$photoOrderd += .$txtChkBox1."n";[/COLOR]

Is it the [COLOR=blue]+=[/COLOR] operator?

ljCharlie
Copy linkTweet thisAlerts:
@ljcharlieauthorOct 24.2003 — I think I found the problem and it has to do with the "[COLOR=blue].[/COLOR] "; however, I do not know how to fix it. I want to add the dot so I can connect multiple variables but it's giving me the error.

ljCharlie
Copy linkTweet thisAlerts:
@YoNOct 24.2003 — change $photoOrderd = <?"Photos you ordered are:nn"; to

[code=php]$photoOrderd = "Photos you ordered are:nn"; [/code]
Copy linkTweet thisAlerts:
@pyroOct 24.2003 — Make the change that YoN pointed out, and also change:

$photoOrderd += .$txtChkBox1."n";

to:

$photoOrderd .= $txtChkBox1."n";
Copy linkTweet thisAlerts:
@ljcharlieauthorOct 24.2003 — PERFECT! You guys are GENIUS!! Thank you!

ljCharlie
Copy linkTweet thisAlerts:
@pyroOct 24.2003 — No problem...
×

Success!

Help @ljcharlie 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.25,
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,
)...