![]() |
Problem with creating a form dynamically - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Problem with creating a form dynamically (/showthread.php?tid=13320) |
Problem with creating a form dynamically - El Forum - 11-18-2008 [eluser]browntown[/eluser] Okay, I have a problem that's driving me nuts. Here's the situation: I have a site where a user can submit an request for an estimate...the admin can then add line items and submit a proposal. The admin can also go back at a later time and add additional items by clicking a "add item" button. I'm using javascript to add additional rows. So my the number of line items will change based on how many items the admin has added. When I come back to the form I'm getting a number of "illegal offset" type of errors. My code is trying to use an array as a counter and I can't figure out why. My form code looks like this: Code: <? The last instance of $i is an array? A var_dump of the last $i produces the following: Code: array(7) { ["name"]=> string(12) "description5" ["id"]=> string(12) "description5" ["value"]=> string(5) "mark7" ["maxlength"]=> string(0) "" ["length"]=> string(2) "50" ["size"]=> string(2) "50" ["style"]=> string(0) "" } Can someone explain why this is happening? I apologize if this is unclear...please let me know if I can clarify anything. Thanks! |