:: Forum >>
Change comma to tilda (or ?) on conversion in toString
I noticed that toString uses a comma as field delimiter. Can I change the comma to some other char or maybe 2 chars?
Reason, I have a text field that could have several comma's, so the toString stops parsing a text field at the first comma in the text.
The current code is:
var myString = gridData[index].toString()
...
var myArray = myString.split(",")
If toString would delimit with something like ~ I could use:
var myArray = myString.split(",")
Or, ... is there a better way to retrieve each col of gridData[index]
Thanks
Norm
Wednesday, February 25, 2004
I fixed the problem by addressing to the columns for 'message' and 'response' that are displayed in textareas with the content corresponding to the currently selected row (ie. index)
note: only indexes 0 thru 5 are shown in the grid
// send to citizen message textarea
document.form_2.p_message.value = gridData[index][6]
// send to response textarea
document.form_2.p_response.value = gridData[index][7]
gridData was populated after a resultSet.getRows after a SELECT from a DB.
thank me me.
Norm
Wednesday, February 25, 2004
I have the same problem.
How to change the comma as field delimiter, the loaded tabbed text file is full of comma's so really want to change this to something like #.
Thanks in advance.
JUMP
Friday, July 29, 2005
Maby you can use %2C in stead of , and do a .replace (regExp)
John Ophof
Friday, July 29, 2005
This topic is archived.
Back to support forum
Forum search