473,385 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Problem with "/n" in Firefox

I am trying to figure this out.

I have the following fuction, which takes value for a hidden field in a
form and display the values on the browser.

The code work fine except in Firefox/Opera, the values get listed in
one line and in IE every entry is a new line.
This is the code:

function teamProcessDiplayCommon(){
var thisDoc = document.forms[0]
var sep ="~~"
var semi =";"
var blank ="-"
var space =" "
var newLine="\n"

//create variable for display value
var StudentIDs=""
var StudentNames=""

var teamListArray=thisDoc.StudentInfoList.value
var studentNotesNameArray=thisDoc.StudentNotesNameList .value
teamListArray=teamListArray.split(";")
studentNotesNameArray=studentNotesNameArray.split( ";")

for (i=0;i<teamListArray.length;i++){
studentInfoArray=teamListArray[i]
studentInfoArray=studentInfoArray.toString().split (sep)

//set display values

StudentIDs +=trim(studentInfoArray[0]) + newLine
StudentNames +=trim(studentInfoArray[1]) +newLine
}

displayDataArray=new Array ()
displayDataArray[0]=StudentIDs
displayDataArray[1]=StudentNames

displayOrderArray=new Array()
displayOrderArray[0]="StudentIDs"
displayOrderArray[1]="StudentNames"

fDHTMLPopulateFields(displayDataArray, displayOrderArray)
}
I tried changing the "/n" to "<br>" but it didnt work and in fact made
things worse.

Any ideas how I can work around this?
Thank you.

Oct 9 '06 #1
7 1373
On Sun, 08 Oct 2006 20:58:38 -0700, effendi wrote:
I am trying to figure this out.

I have the following fuction, which takes value for a hidden field in a
form and display the values on the browser.

The code work fine except in Firefox/Opera, the values get listed in
one line and in IE every entry is a new line.
This is the code:

function teamProcessDiplayCommon(){
var thisDoc = document.forms[0]
var sep ="~~"
var semi =";"
var blank ="-"
var space =" "
var newLine="\n"

//create variable for display value
var StudentIDs=""
var StudentNames=""

var teamListArray=thisDoc.StudentInfoList.value
var studentNotesNameArray=thisDoc.StudentNotesNameList .value
teamListArray=teamListArray.split(";")
studentNotesNameArray=studentNotesNameArray.split( ";")

for (i=0;i<teamListArray.length;i++){
studentInfoArray=teamListArray[i]
studentInfoArray=studentInfoArray.toString().split (sep)

//set display values

StudentIDs +=trim(studentInfoArray[0]) + newLine
StudentNames +=trim(studentInfoArray[1]) +newLine
}

displayDataArray=new Array ()
displayDataArray[0]=StudentIDs
displayDataArray[1]=StudentNames

displayOrderArray=new Array()
displayOrderArray[0]="StudentIDs"
displayOrderArray[1]="StudentNames"

fDHTMLPopulateFields(displayDataArray, displayOrderArray)
}
I tried changing the "/n" to "<br>" but it didnt work and in fact made
things worse.

Any ideas how I can work around this?
Thank you.
I've always used <br /to start a new line. However, I would suggest not
using a variable for the EOL character.

Oct 9 '06 #2

Vaxius wrote:
On Sun, 08 Oct 2006 20:58:38 -0700, effendi wrote:
I am trying to figure this out.

I have the following fuction, which takes value for a hidden field in a
form and display the values on the browser.

The code work fine except in Firefox/Opera, the values get listed in
one line and in IE every entry is a new line.
This is the code:

function teamProcessDiplayCommon(){
var thisDoc = document.forms[0]
var sep ="~~"
var semi =";"
var blank ="-"
var space =" "
var newLine="\n"

//create variable for display value
var StudentIDs=""
var StudentNames=""

var teamListArray=thisDoc.StudentInfoList.value
var studentNotesNameArray=thisDoc.StudentNotesNameList .value
teamListArray=teamListArray.split(";")
studentNotesNameArray=studentNotesNameArray.split( ";")

for (i=0;i<teamListArray.length;i++){
studentInfoArray=teamListArray[i]
studentInfoArray=studentInfoArray.toString().split (sep)

//set display values

StudentIDs +=trim(studentInfoArray[0]) + newLine
StudentNames +=trim(studentInfoArray[1]) +newLine
}

displayDataArray=new Array ()
displayDataArray[0]=StudentIDs
displayDataArray[1]=StudentNames

displayOrderArray=new Array()
displayOrderArray[0]="StudentIDs"
displayOrderArray[1]="StudentNames"

fDHTMLPopulateFields(displayDataArray, displayOrderArray)
}
I tried changing the "/n" to "<br>" but it didnt work and in fact made
things worse.

Any ideas how I can work around this?
Thank you.

I've always used <br /to start a new line. However, I would suggest not
using a variable for the EOL character.

I tried using "<br>" but it was rendered as a text and not html. hence
was dispayed in the browers. Any ideas?

Oct 9 '06 #3

ef*****@epitome.com.sg wrote:
I am trying to figure this out.

I have the following fuction, which takes value for a hidden field in a
form and display the values on the browser.

The code work fine except in Firefox/Opera, the values get listed in
one line and in IE every entry is a new line.
This is the code:

function teamProcessDiplayCommon(){
var thisDoc = document.forms[0]
var sep ="~~"
var semi =";"
var blank ="-"
var space =" "
var newLine="\n"

//create variable for display value
var StudentIDs=""
var StudentNames=""

var teamListArray=thisDoc.StudentInfoList.value
var studentNotesNameArray=thisDoc.StudentNotesNameList .value
teamListArray=teamListArray.split(";")
studentNotesNameArray=studentNotesNameArray.split( ";")

for (i=0;i<teamListArray.length;i++){
studentInfoArray=teamListArray[i]
studentInfoArray=studentInfoArray.toString().split (sep)

//set display values

StudentIDs +=trim(studentInfoArray[0]) + newLine
StudentNames +=trim(studentInfoArray[1]) +newLine
}

displayDataArray=new Array ()
displayDataArray[0]=StudentIDs
displayDataArray[1]=StudentNames

displayOrderArray=new Array()
displayOrderArray[0]="StudentIDs"
displayOrderArray[1]="StudentNames"

fDHTMLPopulateFields(displayDataArray, displayOrderArray)
}
I tried changing the "/n" to "<br>" but it didnt work and in fact made
things worse.

Any ideas how I can work around this?
Thank you.
Did you try wrapping a <pre></pretag around the output?

Oct 9 '06 #4

ke***********@gmail.com wrote:
ef*****@epitome.com.sg wrote:
I am trying to figure this out.

I have the following fuction, which takes value for a hidden field in a
form and display the values on the browser.

The code work fine except in Firefox/Opera, the values get listed in
one line and in IE every entry is a new line.
This is the code:

function teamProcessDiplayCommon(){
var thisDoc = document.forms[0]
var sep ="~~"
var semi =";"
var blank ="-"
var space =" "
var newLine="\n"

//create variable for display value
var StudentIDs=""
var StudentNames=""

var teamListArray=thisDoc.StudentInfoList.value
var studentNotesNameArray=thisDoc.StudentNotesNameList .value
teamListArray=teamListArray.split(";")
studentNotesNameArray=studentNotesNameArray.split( ";")

for (i=0;i<teamListArray.length;i++){
studentInfoArray=teamListArray[i]
studentInfoArray=studentInfoArray.toString().split (sep)

//set display values

StudentIDs +=trim(studentInfoArray[0]) + newLine
StudentNames +=trim(studentInfoArray[1]) +newLine
}

displayDataArray=new Array ()
displayDataArray[0]=StudentIDs
displayDataArray[1]=StudentNames

displayOrderArray=new Array()
displayOrderArray[0]="StudentIDs"
displayOrderArray[1]="StudentNames"

fDHTMLPopulateFields(displayDataArray, displayOrderArray)
}
I tried changing the "/n" to "<br>" but it didnt work and in fact made
things worse.

Any ideas how I can work around this?
Thank you.

Did you try wrapping a <pre></pretag around the output?
Marc, are you saying "<pre></pre>" when using <bror just the ouput
usingb "\n"?

With <pre></pre, using "\n" alone works in IE

Oct 9 '06 #5

ke***********@gmail.com wrote:
ef*****@epitome.com.sg wrote:
I am trying to figure this out.

I have the following fuction, which takes value for a hidden field in a
form and display the values on the browser.

The code work fine except in Firefox/Opera, the values get listed in
one line and in IE every entry is a new line.
This is the code:

function teamProcessDiplayCommon(){
var thisDoc = document.forms[0]
var sep ="~~"
var semi =";"
var blank ="-"
var space =" "
var newLine="\n"

//create variable for display value
var StudentIDs=""
var StudentNames=""

var teamListArray=thisDoc.StudentInfoList.value
var studentNotesNameArray=thisDoc.StudentNotesNameList .value
teamListArray=teamListArray.split(";")
studentNotesNameArray=studentNotesNameArray.split( ";")

for (i=0;i<teamListArray.length;i++){
studentInfoArray=teamListArray[i]
studentInfoArray=studentInfoArray.toString().split (sep)

//set display values

StudentIDs +=trim(studentInfoArray[0]) + newLine
StudentNames +=trim(studentInfoArray[1]) +newLine
}

displayDataArray=new Array ()
displayDataArray[0]=StudentIDs
displayDataArray[1]=StudentNames

displayOrderArray=new Array()
displayOrderArray[0]="StudentIDs"
displayOrderArray[1]="StudentNames"

fDHTMLPopulateFields(displayDataArray, displayOrderArray)
}
I tried changing the "/n" to "<br>" but it didnt work and in fact made
things worse.

Any ideas how I can work around this?
Thank you.

Did you try wrapping a <pre></pretag around the output?

Marc, I placed the <pre></pretag and it work with one problem. My
fonts formating went off. I know this is a properties of the <pre>
tags. Do you have any suggestion?

Oct 9 '06 #6
On Sun, 08 Oct 2006 22:54:04 -0700, effendi wrote:
>
ke***********@gmail.com wrote:
>ef*****@epitome.com.sg wrote:
I am trying to figure this out.

I have the following fuction, which takes value for a hidden field in a
form and display the values on the browser.

The code work fine except in Firefox/Opera, the values get listed in
one line and in IE every entry is a new line.
This is the code:

function teamProcessDiplayCommon(){
var thisDoc = document.forms[0]
var sep ="~~"
var semi =";"
var blank ="-"
var space =" "
var newLine="\n"

//create variable for display value
var StudentIDs=""
var StudentNames=""

var teamListArray=thisDoc.StudentInfoList.value
var studentNotesNameArray=thisDoc.StudentNotesNameList .value
teamListArray=teamListArray.split(";")
studentNotesNameArray=studentNotesNameArray.split( ";")

for (i=0;i<teamListArray.length;i++){
studentInfoArray=teamListArray[i]
studentInfoArray=studentInfoArray.toString().split (sep)

//set display values

StudentIDs +=trim(studentInfoArray[0]) + newLine
StudentNames +=trim(studentInfoArray[1]) +newLine
}

displayDataArray=new Array ()
displayDataArray[0]=StudentIDs
displayDataArray[1]=StudentNames

displayOrderArray=new Array()
displayOrderArray[0]="StudentIDs"
displayOrderArray[1]="StudentNames"

fDHTMLPopulateFields(displayDataArray, displayOrderArray)
}
I tried changing the "/n" to "<br>" but it didnt work and in fact made
things worse.

Any ideas how I can work around this?
Thank you.

Did you try wrapping a <pre></pretag around the output?


Marc, I placed the <pre></pretag and it work with one problem. My
fonts formating went off. I know this is a properties of the <pre>
tags. Do you have any suggestion?
If you want to go with using the <pretags, you could set some properties
of the text with CSS, like:

pre {font-weight:bold}

Oct 9 '06 #7

Vaxius wrote:
On Sun, 08 Oct 2006 22:54:04 -0700, effendi wrote:

ke***********@gmail.com wrote:
ef*****@epitome.com.sg wrote:
I am trying to figure this out.

I have the following fuction, which takes value for a hidden field in a
form and display the values on the browser.

The code work fine except in Firefox/Opera, the values get listed in
one line and in IE every entry is a new line.
This is the code:

function teamProcessDiplayCommon(){
var thisDoc = document.forms[0]
var sep ="~~"
var semi =";"
var blank ="-"
var space =" "
var newLine="\n"

//create variable for display value
var StudentIDs=""
var StudentNames=""

var teamListArray=thisDoc.StudentInfoList.value
var studentNotesNameArray=thisDoc.StudentNotesNameList .value
teamListArray=teamListArray.split(";")
studentNotesNameArray=studentNotesNameArray.split( ";")

for (i=0;i<teamListArray.length;i++){
studentInfoArray=teamListArray[i]
studentInfoArray=studentInfoArray.toString().split (sep)

//set display values

StudentIDs +=trim(studentInfoArray[0]) + newLine
StudentNames +=trim(studentInfoArray[1]) +newLine
}

displayDataArray=new Array ()
displayDataArray[0]=StudentIDs
displayDataArray[1]=StudentNames

displayOrderArray=new Array()
displayOrderArray[0]="StudentIDs"
displayOrderArray[1]="StudentNames"

fDHTMLPopulateFields(displayDataArray, displayOrderArray)
}
I tried changing the "/n" to "<br>" but it didnt work and in fact made
things worse.

Any ideas how I can work around this?
Thank you.

Did you try wrapping a <pre></pretag around the output?

Marc, I placed the <pre></pretag and it work with one problem. My
fonts formating went off. I know this is a properties of the <pre>
tags. Do you have any suggestion?

If you want to go with using the <pretags, you could set some properties
of the text with CSS, like:

pre {font-weight:bold}
Thanks, that was so obvious. but never thought about that.

Oct 9 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alex | last post by:
Hello, I use the following script inside a page. My page contains : 1 FORM, Some Hidden fields, and one line of JAVASCRIPT in order to instantly post the Form. The problem is that under...
8
by: Lian | last post by:
Hi all, It is a newbie's question about html tag "img". The attributes "title" and "alt" for "img" seems having the same function. So what is the main difference between them? Can i use them at...
6
by: Mason A. Clark | last post by:
LAST WORD(s): 1. MSIE6 and Firefox will go to the top of the page on command <a href="#top">go upsy</a> even if there is NO name="top" or id="top" They know what a "top" is :-) Opera...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
7
by: Janis | last post by:
I try to understand what could be the source of a problem with displaying and hiding rows of tables using display:block/none. I've read selfhtml but could not find any hint about that. Any...
3
by: töff | last post by:
On my site http://www.sjcga.com I have a javascript-generated navigation menu in the top right corner. The menu works great in IE and Opera ... but in FireFox, on the 1st click, the menu jumps...
1
by: Charlie | last post by:
I am trying to make an XMLHttpRequest which violates the default "same- origin"policy in Firefox. I checked the archives and found a method that should work but it does not. Below is the test code...
12
by: Dave H. | last post by:
Please redirect me if this message is posted to the wrong group. Given the intention of delivering content to an HTTP user agent (such as Internet Explorer) which is to be immediately opened by...
6
by: SuperFool | last post by:
This has got to be one of those questions only a serious newbie would come up with.... Basicly: I select all the city names in the table and turn them into a pull down menu (code below) print...
3
by: jariwaladivyesh | last post by:
Hi frnds, i have simple XML doc <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="test.xsl"?> <data> <name> Divyesh Jariala</name> </data>
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.