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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Javascript Split Function 1

Status
Not open for further replies.

solok

Programmer
Oct 1, 2003
13
US
The following code works fine when I assign a string (for example: "7,8,9,test";)to the javascript defined variable "mystrg":
<%
var mystrg;
var mylist2;
var mystrgl;
mystrg = Request.Form(&quot;list2&quot;);
Response.Write(&quot; mystrg is &quot; + mystrg );
mylist2 = mystrg.split( &quot;,&quot; );
Response.Write(&quot;<br>&quot; + mylist2[0]);
Response.Write(&quot;<br>&quot; + mylist2[1]);
Response.Write(&quot;<br>&quot; + mylist2[2]);
Response.Write(&quot;<br>&quot; + mylist2[3] + &quot;<br>&quot;);
for (var count = 0; count < mylist2.length; count++)
{ %>
<%
Response.Write(mylist2[count] + &quot;<br>&quot;)
}
%>
But when I assign &quot;Request.Form(&quot;list2&quot;)&quot; to the variable mystrg (which works okay), I get the following error on the split function:

&quot;Microsoft JScript runtime error '800a01b6'
Object doesn't support this property or method&quot;

Help!!!!!

 
Thanks! My co-worker told me about Tek-Tips, this is Great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top