javascript split function

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default javascript split function

    I'm using the split method to put values into an array. When I pass in the
    argument to the function and then use the split method, the delimiters (commas)
    are not removed. I'm not sure why? I was using an alert to show the values
    before and after the split as a test and in both alerts, the commas are still
    there? So, the split isn't parsing out the commas? function
    CheckForm(LoopA,LoopB,LoopC) { alert(LoopA); alert(LoopB); alert(LoopC);
    ArrLoopA = LoopA.split(','); ArrLoopB = LoopB.split(','); ArrLoopC =
    LoopC.split(','); alert(ArrLoopA); alert(ArrLoopB); alert(ArrLoopC); Any
    ideas what might I'm missing? I'm passing in the arguments to the function as
    follows: onClick=' return CheckForm('<%=strAlloList%>', '<%=strStaffList%>',
    '<%=strFundList%>')'> Thanks, -D-

    -D- Guest

  2. Similar Questions and Discussions

    1. Split View Resize Panels Via Javascript
      using Javascript is there a way to resize the panels in split view? make one view larger than the other?
    2. #39838 [NEW]: split function correctly
      From: lu at icst dot org dot tw Operating system: Fedora Core 3 and 6 PHP version: 5.2.0 PHP Bug Type: Unknown/Other Function...
    3. #39838 [Com]: split function correctly
      ID: 39838 Comment by: judas dot iscariote at gmail dot com Reported By: lu at icst dot org dot tw Status: Open...
    4. Need help on split-function
      Hi All, What I want to is using a string as PATTERN in a split function. This makes it possible for me to change the PATTERN on one place in my...
    5. Problem with split function
      Hi all, I am having a problem with the split function. Here is my code: $_ = "123 a 456 b 789 c"; my @words = split /+/, $_; print...
  3. #2

    Default Re: javascript split function

    -D- wrote:
    > I'm using the split method to put values into an array. When I pass in the
    > argument to the function and then use the split method, the delimiters (commas)
    > are not removed. I'm not sure why? I was using an alert to show the values
    > before and after the split as a test and in both alerts, the commas are still
    > there? So, the split isn't parsing out the commas? function
    > CheckForm(LoopA,LoopB,LoopC) { alert(LoopA); alert(LoopB); alert(LoopC);
    > ArrLoopA = LoopA.split(','); ArrLoopB = LoopB.split(','); ArrLoopC =
    > LoopC.split(','); alert(ArrLoopA); alert(ArrLoopB); alert(ArrLoopC); Any
    > ideas what might I'm missing? I'm passing in the arguments to the function as
    > follows: onClick=' return CheckForm('<%=strAlloList%>', '<%=strStaffList%>',
    > '<%=strFundList%>')'> Thanks, -D-
    >
    If you use: alert(ArrLoopA[0]) instead of: alert(ArrLoopA), you will see
    the array values. And of course you should use also ArrLoopA[i] with i
    going from 0 to (ArrLoopA.length-1) to retrieve the individual values...

    HTH
    Bernard
    bthouin Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139