Click to See Complete Forum and Search --> : Fetch form data tweak


iisha
08-18-2008, 08:26 AM
Hi folks.

I have a big doubt on this. I had much more fields than these but here goes.
I have a form in which I consider two "settings" for a field: if it is included and if it is a date. I want to grab all the fields settings like this:

<form>
<input type="checkbox" name="field[id][include]" />

<input type="checkbox" name="field[is][isDate]" />

<input type="checkbox" name="field[type_id][include]"/>
</form>

Supposingly I should get, in this case, three (3) variables in the $_POST array. Happens I only have 1 :S

array(1) { [0]=> string(5) "field" }

How can I get this to work? If not, any alternatives?

scragar
08-18-2008, 08:45 AM
duplicating your code and setting a value attribute gives me an intresting result:

array(1) {
["field"]=>
array(3) {
["id"]=>
array(1) {
["include"]=>
string(1) "a"
}
["is"]=>
array(1) {
["isDate"]=>
string(1) "b"
}
["type_id"]=>
array(1) {
["include"]=>
string(1) "c"
}
}
}