Welcome to WebmasterWorld Guest from 107.22.7.35

Forum Moderators: open

Message Too Old, No Replies

Adding Line Breaks into Text Area

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

10+ Year Member



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

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

10+ Year Member



WORKED IT OUT!

\n does the trick for anyone who is interested.

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

Kind Regards

Walker

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

10+ Year Member



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>

 

Featured Threads

Hot Threads This Week

Hot Threads This Month