/    Sign up×
Community /Pin to ProfileBookmark

print line by line in Text Area

what is the value i need to replace for [B]<cr>[/B] to make break the lines and show in Text Area.

Example
Lieude l’incident – Location of Incident<cr>111111111<cr>Expliquez ce qui s’est passé – Explain what happened<cr>2222222222<cr>Conséquences potentielles – Potential Consequences<cr>333333333<cr>

[B]Expected Result in Text ARea[/B]

Lieude l’incident – Location of Incident
111111111
Expliquez ce qui s’est passé – Explain what happened
2222222222
Conséquences potentielles – Potential Consequences
333333333

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@Mr_JSep 29.2006 — Here's one possibility

[code=php]<textarea id="t1" style="width:600px;height:200px;"></textarea>

<script type="text/javascript">

str="Lieude l'incident - Location of Incident<cr>111111111<cr>Expliquez ce qui s'est passé - Explain what happened<cr>2222222222<cr>Conséquences potentielles - Potential Consequences<cr>333333333<cr>"

str=str.replace(/<cr>/gi,"n")

document.getElementById("t1").value=str

</script>
[/code]
Copy linkTweet thisAlerts:
@raghu123authorOct 03.2006 — Mr J,

What is meaning of

[B]/<cr>/gi[/B]

in

str=str.replace(/<cr>/gi,"n")
Copy linkTweet thisAlerts:
@sridhar_423Oct 03.2006 — replaces all occurences("g") of "<cr>" with "n" and case-insensitive("-i")
×

Success!

Help @raghu123 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.8,
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,
)...