Welcome Guest, Not a member yet? Register   Sign In
Re-populating form with 2 dimensional indexed array
#6

[eluser]meigwilym[/eluser]
Ok, but take it to the next step and
Code:
<input type="text" name="expenses[1][name]" value="" />
<input type="text" name="expenses[1][amount]" value="" />

<input type="text" name="expenses[2][name]" value="" />
<input type="text" name="expenses[2][amount]" value="" />

<input type="text" name="expenses[3][name]" value="" />
<input type="text" name="expenses[3][amount]" value="" />

<input type="text" name="expenses[4][name]" value="" />
<input type="text" name="expenses[4][amount]" value="" />

<input type="text" name="expenses[5][name]" value="" />
<input type="text" name="expenses[5][amount]" value="" />

<input type="text" name="expenses[6][name]" value="" />
<input type="text" name="expenses[6][amount]" value="" />

works!
Code:
array(1) {
  ["expenses"]=>
  array(6) {
    [1]=>
    array(2) {
      ["name"]=>
      string(1) "1"
      ["amount"]=>
      string(1) "2"
    }
    [2]=>
    array(2) {
      ["name"]=>
      string(1) "3"
      ["amount"]=>
      string(1) "4"
    }
    [3]=>
    array(2) {
      ["name"]=>
      string(1) "5"
      ["amount"]=>
      string(2) "67"
    }
    [4]=>
    array(2) {
      ["name"]=>
      string(2) "89"
      ["amount"]=>
      string(1) "9"
    }
    [5]=>
    array(2) {
      ["name"]=>
      string(1) "1"
      ["amount"]=>
      string(1) "2"
    }
    [6]=>
    array(2) {
      ["name"]=>
      string(1) "3"
      ["amount"]=>
      string(1) "4"
    }
  }
}

Mei


Messages In This Thread
Re-populating form with 2 dimensional indexed array - by El Forum - 02-22-2012, 04:18 AM
Re-populating form with 2 dimensional indexed array - by El Forum - 02-22-2012, 05:05 AM
Re-populating form with 2 dimensional indexed array - by El Forum - 02-22-2012, 05:23 AM
Re-populating form with 2 dimensional indexed array - by El Forum - 02-22-2012, 08:17 AM
Re-populating form with 2 dimensional indexed array - by El Forum - 02-22-2012, 08:28 AM
Re-populating form with 2 dimensional indexed array - by El Forum - 02-22-2012, 08:45 AM
Re-populating form with 2 dimensional indexed array - by El Forum - 02-22-2012, 01:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB