Too much code just to output a form - 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: Too much code just to output a form (/showthread.php?tid=20031) Pages:
1
2
|
Too much code just to output a form - El Forum - 06-25-2009 [eluser]dopple[/eluser] Am I missing something or does this seem like an awful lot of code to output a form with 6 text fields and a submit button? Is there a cleaner way to do this? Code: <?php Too much code just to output a form - El Forum - 06-25-2009 [eluser]Dam1an[/eluser] Why yes that is a lot of code for a form with 6 input fields, which is why I don't use the form helpers. Why don't you just do it using normal HTML? (although I do still use set_value from the validation library in my forms) Too much code just to output a form - El Forum - 06-25-2009 [eluser]ggoforth[/eluser] I agree. I don't use the form helpers either. Plain HTML seems to be the way to go here. Like the previous poster I do make good use of set_value(). Too much code just to output a form - El Forum - 06-25-2009 [eluser]Dam1an[/eluser] [quote author="ggoforth" date="1245979582"]Like the previous poster I do make good use of set_value().[/quote] The 'previous poster' has a name Too much code just to output a form - El Forum - 06-25-2009 [eluser]ggoforth[/eluser] [quote author="Dam1an" date="1245979829"]The 'previous poster' has a name [/quote] Sorry Damian, I was on my iPhone so I was zoomed in on the post content and couldn't see the avatar. My bad! Greg Too much code just to output a form - El Forum - 06-25-2009 [eluser]slowgary[/eluser] The previous poster is always on his stupid iPhone, GOSH! ;-P I don't use the form helper either, or any of the HTML helpers as I think they're silly (although I can see the benefit of table or multidimensional unordered list generation). I also don't understand how one would go about creating a complex form with a nice layout using the helper, as I usually layout my forms with a table and sometimes there are just so many colspans/rowspans that it's confusing enough just doing it with HTML. Too much code just to output a form - El Forum - 06-25-2009 [eluser]Dam1an[/eluser] I thought you where going to say the previous poster is always Damian lol And Eugh! tables for forms? Too much code just to output a form - El Forum - 06-25-2009 [eluser]slowgary[/eluser] I don't use tables for site layout, and I really think they should be reserved for data in a grid (which is what they were made for), but I just don't know a better way to layout forms. Are your forms div based or something else? Too much code just to output a form - El Forum - 06-25-2009 [eluser]Dam1an[/eluser] Yeah, divs all the way I'll try dig out a few resources for you when I get to work (about to leave the house now) Too much code just to output a form - El Forum - 06-26-2009 [eluser]ggoforth[/eluser] I am guilty of occasionally using tables to layout forms. I have started doing something like this though: Code: <div> The code above keeps all the form elements laid out evenly and no tables had to be used. This is now my primary method for laying out forms. (Oh, I used inline styles here just to demonstrate the principal. That would usually be found in my css sheets. Greg |