line break in address?

hi guys...I am trying to pull information from a few of my text boxes and insert them into another one. the code I am using is as follows

this.getField("testtest").value = this.getField("address").value + " " + this.getField("City").value + ", " + this.getField("province").value + " " + this.getField("postal_code").value;

This is for an address, city, province, and postal code. Currently how it displays is for example

12345 67 Street Mycity, Myprovince V1V1V1

what I would like to do is display it as the following. How can I essentially put in a <br> after the address

12345 67 Street
Mycity, Myprovince
V1V1V1

thanks


Shane N


2 Answers

Voted Best Answer

For those who do not wish to search for the answer:


Since the days of the ASR35 or TTYs there have been non-printable control code that included some formatting character codes like tab, new line, and carriage return. Depending upon the programing language the special code need a prefix characrter to idicate that following letter is a special code. In JavaScript that cahracter is the "\" backward slash. The new line code is "\l" and the carriage return is "\n". Some sytems or devices require both cods while others only need one. In JavaScript you can use eitehr.


this.getField("testtest").value = this.getField("address").value + "\n " + this.getField("City").value + ", " + this.getField("province").value + "\n " + this.getField("postal_code").value;




By George Kaiser   

nevermind! solved! sorry

\n

simple!


Shane N   


Please specify a reason: