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 - 05-16-2011 [eluser]k7faq[/eluser] Looking at the code, I stand corrected. The Error, if set for "inline" will only appear following the field. Looking at the code you would need to search for $this->_make_error(); and change the order in each field type. You will see something like: function text() { $atts = $this->_filter_atts('input'); $el = $this->_make_label('before'); $el .= $this->field_prefix.form_input($atts).$this->field_suffix; $el .= $this->_make_label('after'); --> $el .= $this->_make_error(); return $this->element_prefix.$el.$this->element_suffix; } Theoretically if you move the line with "$el .= $this->_make_error();" up in the order of processing such as: function text() { $atts = $this->_filter_atts('input'); $el = $this->_make_label('before'); --> $el .= $this->_make_error(); $el .= $this->field_prefix.form_input($atts).$this->field_suffix; $el .= $this->_make_label('after'); return $this->element_prefix.$el.$this->element_suffix; } This would case the error to be generated and listed before the field but following the label. Hope this helps. Form Generation Library - El Forum - 05-17-2011 [eluser]tieungao[/eluser] Thanks so much for your clearly instruction, So we not have option to control without break into Library code. Because i scare for later uppdate maybe have, so i hope have option to change it. But ok your solution is exactly what i want to this time. Thanks again for your kindly help! Form Generation Library - El Forum - 05-23-2011 [eluser]tieungao[/eluser] I got strange error with this library : Code: <div style="border: 1px solid rgb(153, 0, 0); padding-left: 20px; margin: 0pt 0pt 10px;"> my application/config/form.php Code: <?php my controller : Code: //change password Form Generation Library - El Forum - 05-24-2011 [eluser]Infinitation[/eluser] New question regarding the form generation library. I couldn't find it the documentation or in searching the forums, but is there a way to designate what select option is selected? I'm working on an edit screen and while I can get my custom select dd working, I cannot figure out how to have it preselect the option that it is. Any help would be appreciated! [Of course when I post this I figure it out that I overlooked the documentation, been staring at the screen too long!] Form Generation Library - El Forum - 05-27-2011 [eluser]Unknown[/eluser] It is likely that this has been reported before, but I found a little bug in 1.0.4. Checkboxes (did not check on radio boxes) do not repopulate. Line 1737 of Form_validation.php holds the error. Code: // If the data is an array output them one at a time. This does not work for the form_generation library which needs all of the values every time. My quick fix was to comment out this code, but there should be a in library fix. Perhaps something that stores the previous values? Thoughts? Form Generation Library - El Forum - 06-05-2011 [eluser]Unknown[/eluser] I am loving this library so far and have not found any bugs in it. I'm currently modifying the tank_auth class to use this form library and I noticed this library does not have support for captchas. Is the captcha element planned in an upcoming release? The tank_auth library provides support for Re-Captcha. It might be a quick solution. I began learning the CI framework yesterday or I would try to update this library to include the captcha element. I might have to anyway *EDIT* And I dive in and see the function for recaptcha element creation and then I notice it's documented too!!! lol Form Generation Library - El Forum - 06-10-2011 [eluser]Unknown[/eluser] Hy all, I found a little bug in the form generator. When you try to repopulate a multiple select with multiple values only one option gets selected. This can be fixed by changing line 644 of the library (Form.php) from: Code: $el .= $this->field_prefix.form_dropdown($this->name, $this->options, $this->selected, $atts).$this->field_suffix; to: Code: if (count($this->atts["selected"]) > 1) Hope this helps anyone so they don't need to spend an hour debugging the (absolutely great) library. I hope this will be fixed in the next release. Gr Sandhje Bouw Form Generation Library - El Forum - 06-15-2011 [eluser]Mat-Moo[/eluser] I'm working on a form that has some quite complex form validation at the moment (Sections that open and close with required or not depending on other values). At present I do the complex validation in my model callback (Before saving), however if the validation fails then the model is not called and my additional errors are not shown. It would seem a nice extra feature to add a extra_validation() method that is called during your validation process with (&$form, $data) so that this would not be in the model but in the controller and all errors shown at the same time. (Does this make sense? Form Generation Library - El Forum - 06-15-2011 [eluser]marcogmonteiro[/eluser] Loved your library, well made and well documented keep it up. I'll probably give it a go on my next CI project Form Generation Library - El Forum - 06-22-2011 [eluser]Mat-Moo[/eluser] Hmmm, I'm using the latest version and I've got a problem with Muti-selects not showing all the options selected after validation failed. Only the top items gets picked - any ideas? |