effective way to POST an array of parameter code and values

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jrefactors@hotmail.com

    effective way to POST an array of parameter code and values

    If we have an array of parameterCode and parameterValue, what is the
    best way to POST those
    information?

    Approach #1, I don't think this will work

    parameterCode=1 A&parameterValu e=1B&parameterC ode=2A&paramete rValue=2B&param eterCode=3A&par ameterValue=3B

    Approach #2:

    parameterCode_1 =1A&parameterVa lue_1=1B&parame terCode_2=2A&pa rameterValue_2= 2B&parameterCod e_3=3A&paramete rValue_3=3B
    Please advise. thanks!!

  • SPG

    #2
    Re: effective way to POST an array of parameter code and values

    Why not post all the values in one param, concatenated and separated by a
    delimiter?

    So...

    IE:

    parameterCode=p aramVal1|paramV al2|paramVal3 and so on..

    Then in the script to read the vals, you can do this:

    var paramArray = parameterCode.s plit("|");

    which would give you an array of strings based ont he value of the
    parameterCode variable

    (Note: Assuming you are passing the value of the post parameter
    "parameterC ode" to a function..)

    Bit vauge and sketchy but hopt this points you to the rigth solution

    Steve

    <jrefactors@hot mail.com> wrote in message
    news:1104180682 .399993.135270@ z14g2000cwz.goo glegroups.com.. .[color=blue]
    > If we have an array of parameterCode and parameterValue, what is the
    > best way to POST those
    > information?
    >
    > Approach #1, I don't think this will work
    >
    > parameterCode=1 A&parameterValu e=1B&parameterC ode=2A&paramete rValue=2B&param eterCode=3A&par ameterValue=3B
    >
    > Approach #2:
    >
    > parameterCode_1 =1A&parameterVa lue_1=1B&parame terCode_2=2A&pa rameterValue_2= 2B&parameterCod e_3=3A&paramete rValue_3=3B
    > Please advise. thanks!!
    >[/color]


    Comment

    Working...