listing elements

Results 1 to 2 of 2

Thread: listing elements

  1. #1
    Join Date
    Dec 1969

    Default listing elements

    i am trying to list the elements using the following, but am getting errors...<BR><BR>&#060;%<BR>var tmp = String(Request.Form("myChoice"));<BR>var tmpArray = tmp.split(", ");<BR>for (var i=0; i&#060;tmpArray.length; i++)<BR>{<BR> // tmpElement will be individual values that you can process<BR> var tmpElement = tmpArray[i];<BR> Response.Write("Element: " + tmpElement + ".<BR>");<BR>}<BR>%&#062;<BR><BR>the error is the semi-colon after "tmp.split(", ");"

  2. #2
    Join Date
    Dec 1969

    Default RE: listing elements

    Just possibly the version of JScrip you are using in your ASP engine doesn&#039t support the split method on a String object?<BR><BR>That would explain the error.<BR><BR>But I just checked MS docs and it looks like split has been around since day one. Hmmm....<BR><BR>What is the error you get???<BR><BR>What are the contents of tmp at that point? (Do a Response.Write("tmp="+tmp+"&#060;P&#062;"); to see, for sure!)<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts