|
-
Mar 17th, 2004, 04:51 PM
#1
Help Needed
i have a function that i call as follows :
writeComboItem("'<img src=flags/MY.gif>',' MY',' MY'","#7D7DFF","Sample1147","MY","MY","Sample1");
the start of the function looks like this
function writeComboItem(ComboArray,TRbg,TRid,TRval,val2Store,cboName) {
var arrComboArray = new Array(ComboArray)
how can i feed in the array to the function? currently it doesn't work and just treets it as a single string
Thanks Kris
-
Mar 19th, 2004, 02:41 AM
#2
-
Mar 20th, 2004, 07:06 PM
#3
-
Mar 20th, 2004, 07:13 PM
#4
Frenzied Member
Re: Help Needed
Originally posted by i00
how can i feed in the array to the function?
??
do you want all those parameters in one array? Do you want the function to do this?
Have I helped you? Please Rate my posts. 
-
Mar 21st, 2004, 06:04 AM
#5
-
Mar 21st, 2004, 07:24 AM
#6
Frenzied Member
ok, this function will shove all the parameters into one array (called myArr):
Code:
function writeComboItem(ComboArray,TRbg,TRid,TRval,val2Store,cboName) {
myArr = new Array()
myArr[0] = ComboArray
myArr[1] = TRbg
myArr[2] = TRid
myArr[3] = TRval
myArr[4] = val2Store
myArr[5] = cboName
}
Have I helped you? Please Rate my posts. 
-
Mar 21st, 2004, 04:57 PM
#7
ino that ... but i don't no how long the array will be - look @ my example
i have a function that i call as follows :
writeComboItem(" '<img src=flags/MY.gif>',' MY',' MY' ");
take note of the double and single quotes - i put the space inbetween to make it easyer to see
the start of the function looks like this
function writeComboItem(ComboArray) {
var arrComboArray = new Array(ComboArray)
now i want the array arrComboArray to hold the values: (in this example)
[0] <img src=flags/MY.gif>
[1] MY
[2] MY
but the length may vary because i am feeding into it with asp
thanks kris
Last edited by i00; Mar 21st, 2004 at 05:01 PM.
-
Mar 21st, 2004, 05:29 PM
#8
Frenzied Member
if they are always seperated by comma, and none of the variable will hold a comam then you can do this:
Code:
function a(myStr) {
myArr = myStr.split(",")
}
now a(" 'a', 'b' , 'r' ") will create an array called myArr which is as follows:
myArr[0] = " 'a' "
myArr[1] = " 'b' "
myArr[2] = " 'r' "
I would run the function as follows though:
a("a,b,c,d")
which would give you
myArr[0] = "a"
myArr[1] = "b"
myArr[2] = "c"
myArr[3] = "d"
Have I helped you? Please Rate my posts. 
-
Mar 21st, 2004, 05:34 PM
#9
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|