Welcome Guest, Not a member yet? Register   Sign In
form_validation library with input arrays
#1

[eluser]coffeeandcode[/eluser]
Hi all, I'm having difficulties getting ci's form_validation library to work with an input array I have. My variable is an array of text inputs containing product quantities, indexed by product id:

Code:
Array
(
    [quantities] => Array
        (
            [155530] => 4
            [252605] => 2
            [295539] => 6
            [176950] => 3
            [155531] => 9
            [155529] => 0
            [155528] => 9
            [155526] => 1
            [258971] => 9
            [258967] => 3
            [258972] => 1
            [161637] => 7
            [161631] => 3
        )

)

The problem is, ci requires that the EXACT variable name is used everywhere, and in my case that is dynamic. I can get it to validate when I use "quantities[]" as the variable name, but then I lose the product id. Am I missing something? I would think this would be a simple thing to do...


Messages In This Thread
form_validation library with input arrays - by El Forum - 08-23-2010, 03:21 PM
form_validation library with input arrays - by El Forum - 08-23-2010, 04:23 PM
form_validation library with input arrays - by El Forum - 08-24-2010, 08:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB