Form Generation Library |
[eluser]Ollie Rattue[/eluser]
[quote author="macigniter" date="1239245438"]I am a little scared that some of you will tear me apart if they look at the source code and find horrible programming techniques ![]() Release early, release often ![]() I built something similiar called FormIgniter and so am really interested to see how this library works out. I was thinking about building a library like this but it ended up turning into a kind of webapp formigniter.org
[eluser]macigniter[/eluser]
Alright!! I am releasing a VERY EARLY PRE-RELEASE BETA ;-) I am using it in one of my projects and constantly change stuff when I see some bugs or unlogical things come up. Also the script still throws quite some notices which is on my to-do list to clean up the code and make it not only look prettier, but also better. Since so many of you wanted to give it a shot I thought I'd post this library even though I haven't been able to finish the user guide yet. I did take some time to create a welcome controller that includes a form with lots of comments on the usage of the library. NOTE: I would prefer if you sent bugs or code improvements directly to my email address at [email protected] Thanks for beta testing and for your patience. I hope you enjoy the library! Download Form Generation Library [Link removed, please refer to the current version in the first post!] Please read the config file section in the user guide that explains the configuration options in detail! Link to the online version: Example Form Link to the user guide: User Guide (not yet completely finished) Feedback is welcome! (only if it isn't about the bad coding ;-))
[eluser]shreder[/eluser]
Wow, thanks! I will test it and let you know any bugs I find. Just a quick question: How would I repopulate fields? especially a radio field? Thanks!
[eluser]macigniter[/eluser]
What exactly do you mean by "re"populate? Please take a look at the user guide (see link in post above) and let me know if that answers your question.
[eluser]Kyle Johnson[/eluser]
I really like seeing your code, though I haven't had the chance to dig through it thoroughly. It gives me a lot of reasons to learn all about PHP. There is a lot of code in it! I did run into some small issues with my custom Form_validation that was specifically built to help with array inputs like "email[]" but it seems like you have taken care of that within your code, so I just had to remove my Form_validation / Form_helper Great work so far! I'm betting this could be included within the next major release of CI if you feel confident enough in your code by then.
[eluser]macigniter[/eluser]
Kyle, the library automatically populates all "checkgroups", "radiogroups" and "selects" as arrays, no need to add [] after the name. In return all data returned from checkgroups, radiogroups and selects are arrays. So if you want to access a submitted value from a group of checkboxes you will have to do something like: Code: ... In a multiple select field or in checkgroups the array contains all selected/checked values. Btw... I haven't really thought about using arrays in regular text inputs yet. Never really used that feature in any of my forms. But it made me think when you wrote email[] in your example. I guess if you want to use arrays for text fields you still need to add the '[]', otherwise the form won't know you want to use an array of fields. Haven't tried if that works, though. Let me know if it does...
[eluser]Kyle Johnson[/eluser]
You might be hearing a lot from me, I've been designing the backend of our web application for a while, and am now into the form generation bit. One thing I noticed is that if I add an 'onchange="this.form.submit()"' event to any of my selects, then when the form submits, the old data does not repopulate the form. I may end up using some AJAX to do the changing bits in the future, and I'm sure that would work, but I usually start out with quick solutions. Fun fun!
[eluser]macigniter[/eluser]
Thanks for the notice. I will change the script to work with 'onchange="this.form.submit()"' in the next release. I'll put it on my to-do list :-)
[eluser]gregor4711[/eluser]
Hi, exactly what I'm searching for. ![]() I know it is pre beta, but 3 questions: - how can I integrate A HTML editor like tinyMCE? - how can I integrate a date picker? - how con a setup a form with cascaded drop down boxes? my be it is already planed from your side for the next release. Many thanks, Gregor |
Welcome Guest, Not a member yet? Register Sign In |