Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2006
    Posts
    56

    Unanswered: form inputs with same name - can't get them on the server side

    I got a form that have elements with auto-generated arrays for their name, something like:

    pseudo-code
    HTML Code:
    <input type=text name=argument[][0] />
    <input type=text name=argument[][1] />
    
    <input type=text name=argument[][0] />
    <input type=text name=argument[][1] />
    
    <input type=text name=argument[][0] />
    <input type=text name=argument[][1] />
    Whilst trying to get their values on the server-side, I'm bumping into some issue I cannot identify. All I know is that I can get argument[$i][0] value, but not argument[$i][1].

    Is that something I just can't do?

    Should I post more coding?


    Edit:
    I just saw my pitfall. I'm getting on the server-side:
    argument[0][0]
    argument[1][1]
    argument[2][0]
    argument[3][1]
    argument[4][0]
    argument[5][1]
    and so on.

    What I hoped it would do, was get it like this:
    argument[0][0]
    argument[0][1]
    argument[1][0]
    argument[1][1]

    I wish I could do this some way that I had all these inputs with the same "argument" name... is this at all possible?
    Last edited by igordonin; 05-02-12 at 15:14. Reason: more info

  2. #2
    Join Date
    Jul 2006
    Posts
    56
    just for the purpose of closure, this is solved.

    I named them "argument[0][]" and "argument[1][]" in my HTML and now I can iterate through them correctly on PHP.


    c ya

Posting Permissions

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