Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how send an array value to script

Status
Not open for further replies.

jimmyweb

Programmer
Dec 9, 2004
37
US
Hi Friends,
When I created javascript with a array
as testing.Value = Array( input_value)
however, input_value only as a string send to javascript function. such string A= "6/6/2005","6/7/2005","6/8/2005","6/9/2005","6/10/2005","6/11/2005","6/12/2005","6/13/2005","6/14/2005"
B = 1,3,5,6.1,7,233,2,1

Do we have any way to convert A string to a date array
and B string to number array for input_value?

Thanks for any help!!
Nice day
Jim
 
A and B as such is nothing. You have to make it a real string.
[tt]A= [red]'[/red]"6/6/2005","6/7/2005","6/8/2005","6/9/2005","6/10/2005","6/11/2005","6/12/2005","6/13/2005","6/14/2005"[red]'[/red];
B = [red]'[/red]1,3,5,6.1,7,233,2,1[red]'[/red][/tt];
Then, you can use split.
[tt]var arrA=A.split(".");
var arrB=B.split(",");[/tt]
Then arrA's component is string _including_ quotes! Maybe this form of A would serve you better.
[tt]A= [red]'[/red]6/6/2005,6/7/2005,6/8/2005,6/9/2005,6/10/2005,6/11/2005,6/12/2005,6/13/2005,6/14/2005[red]'[/red];[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top