homepage Welcome to WebmasterWorld Guest from 54.166.148.189
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Adding Line Breaks into Text Area
walker




msg:1483875
 12:11 pm on Jul 25, 2003 (gmt 0)

Hi

Does anyone know how to add a line break into a text area.

Below is a really simplified version of what I need to do.

$Ptext1="Here would be text for paragraph 1"

$Ptext2="Here would be text for paragraph 2"

<script language="JavaScript">
<!--
function ShowText1() {

var TheText=$Ptext1 + *****NEEDLINEBREAK***** Ptext2;

OptionText.TextAREA.value=TheText;

}
-->
</script>

<form Name="OptionText">

<input type="checkbox" name="TextOption1" onclick="ShowText1()">

<textarea rows="5" name="TextAREA"></textarea>
</form>

Kind Regards

Walker

 

walker




msg:1483876
 12:27 pm on Jul 25, 2003 (gmt 0)

WORKED IT OUT!

\n does the trick for anyone who is interested.

var TheText=$menu1_link2 + "\n" + $menu1_link

Kind Regards

Walker

Pricey




msg:1483877
 12:43 pm on Jul 25, 2003 (gmt 0)

Try:

$Ptext1="Here would be text for paragraph 1"

$Ptext2="Here would be text for paragraph 2"

<script language="JavaScript">
<!--
function ShowText1() {

var TheText=$Ptext1 + "\n" + $Ptext2;

OptionText.TextAREA.value=TheText;

}
-->
</script>

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved