Form Generation Library - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Form Generation Library (/showthread.php?tid=16439) |
Form Generation Library - El Forum - 12-24-2009 [eluser]macigniter[/eluser] [quote author="combatCoder" date="1261609025"]Any ideas why this is not validating? Does anyone know if there is a issue with using the onchange to submit and not a button?[/quote] Actually it is the missing submit() button that is causing the form not to validate. The form is checking the value of the submit button to check whether the form was submit or not. So this is a tricky one. For now my best solution is adding the following code to the library: Code: // add this just below function set_value() in libraries/Form.php Then you can simply do: Code: $type = array( I think that this trigger() method is the best solution for now. I will add it to the next offical version. Thanks for pointing this out! Form Generation Library - El Forum - 12-24-2009 [eluser]macigniter[/eluser] off topic: MERRY CHRISTMAS EVERYONE :-D Form Generation Library - El Forum - 12-25-2009 [eluser]Jakebert[/eluser] Help! I'm trying to to an update form, I finally got the values to populate from the DB: Code: function edit($sid) My code is not throwing any errors, but here is the model: Code: function edit(&$form, $data) Why are my entries not updating? Thanks! P.S. I find it annoying that the onsuccess() method forces you to call another function instead of just going to a view. Maybe that could be something for future updates? Form Generation Library - El Forum - 12-25-2009 [eluser]hugle[/eluser] [quote author="Jakebert" date="1261746420"]Help! I'm trying to to an update form, I finally got the values to populate from the DB: Code: function edit($sid) My code is not throwing any errors, but here is the model: Code: function edit(&$form, $data) Why are my entries not updating? Thanks! P.S. I find it annoying that the onsuccess() method forces you to call another function instead of just going to a view. Maybe that could be something for future updates?[/quote] Hello, I think you should switch: Code: ->model('student_model', 'edit'); in that way, first the model is called, then you are redirected to 'success' controller Good luck Form Generation Library - El Forum - 12-25-2009 [eluser]hugle[/eluser] [quote author="macigniter" date="1261672846"]off topic: MERRY CHRISTMAS EVERYONE :-D[/quote] same with you ))) all the good to you, and anyone else reading and not reading this post )) Form Generation Library - El Forum - 12-25-2009 [eluser]Jakebert[/eluser] Fixed. Had to add $sid as a hidden input to the form. merry christmas! Form Generation Library - El Forum - 12-25-2009 [eluser]Jakebert[/eluser] New question now (should I make a new thread for this, btw?): Is there a more efficient way to do what I'm doing now which is: Code: $this->form->open('admin/students/add') and then have an add_success() function that just redirects to a view AND in the model: Code: $sid = $data['sid']; Is there no way to get the form to send the required data directly to the model without having to do all that transferring? Form Generation Library - El Forum - 12-25-2009 [eluser]dinhtrung[/eluser] @macigniter: Can't wait for the new release anymore... Is there any schedule for the new version already? I'd like to help, too. Form Generation Library - El Forum - 12-25-2009 [eluser]macigniter[/eluser] [quote author="Jakebert" date="1261750184"]Is there no way to get the form to send the required data directly to the model without having to do all that transferring?[/quote] Sure. Just don't use the onsuccess() method. Instead do something like this: Code: $this->form Form Generation Library - El Forum - 12-25-2009 [eluser]hugle[/eluser] [quote author="dinhtrung" date="1261752249"]@macigniter: Can't wait for the new release anymore... Is there any schedule for the new version already? I'd like to help, too.[/quote] soon, very soon |