Welcome Guest, Not a member yet? Register   Sign In
How Best to Pass Variables From a View to a Model
#4

[eluser]vincej[/eluser]
Thanks so much for the feedback. I appreciate that JS could be a route however, I would prefer to stay away from that as it complicates things considerably.

Thanks M52 for your thoughts, however, I think I need to explain myself better. My form presents products, eg:

Quantity / ID / ProductName / Price / Total / Delete

My code loops through the OPen_orders Session variable and generates as many lines as the customer has ordered. The customer can now change the quantity or delete the line ( checkbox). These are post variables. The other data items are also post variables as a hidden value. All is good, untill you try to upload to the controller.

My problem is that there might be 20 line items ie 20x 'ProductName', ID, Total etc.

I need to capture this as an array.

I'm really unsure how to upload all these values as 1 single array in the controller / Model as they all have the same name in the HTML form. My code as it stands works - except that it only grabs the last product line, because there is no array grabbing all the values I assume.

Maybe I'm being stupid here. Maybe it's obvious.

Anyway - anyone who might steer me in the correct direction, will be forever in my Gratitude !

Many thanks !!


Messages In This Thread
How Best to Pass Variables From a View to a Model - by El Forum - 04-20-2012, 04:24 PM
How Best to Pass Variables From a View to a Model - by El Forum - 04-20-2012, 11:16 PM
How Best to Pass Variables From a View to a Model - by El Forum - 04-21-2012, 12:00 AM
How Best to Pass Variables From a View to a Model - by El Forum - 04-21-2012, 05:01 PM
How Best to Pass Variables From a View to a Model - by El Forum - 04-21-2012, 08:58 PM
How Best to Pass Variables From a View to a Model - by El Forum - 04-22-2012, 10:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB