Welcome Guest, Not a member yet? Register   Sign In
CI form 'best practices'
#2

[eluser]Chicken's Egg[/eluser]
I Don't understand your first question, so I will start with the second one.

I don't see any reason to avoid the form helper. Yes, creating forms in html isn't that much work for an experienced html-writer, but the form_validation library works well together with form helper.

As for your third question. Yes, you should put a rule (remember: empty rules are rules too) on each field to get it repopulated when the form validates to false. For textareas you might consider using xss_clean and trim.

If you would like to validate file uploads too, you might also be interested in this extension of the library:
http://ellislab.com/forums/viewthread/123651/
But there are others (and more extensive ones) out there. However, if you don't feel the need for an extension, you could use a callback to check the validity of a date.


Messages In This Thread
CI form 'best practices' - by El Forum - 08-04-2009, 07:27 AM
CI form 'best practices' - by El Forum - 08-04-2009, 10:36 AM
CI form 'best practices' - by El Forum - 08-04-2009, 12:24 PM
CI form 'best practices' - by El Forum - 08-05-2009, 12:59 AM
CI form 'best practices' - by El Forum - 08-05-2009, 01:34 AM
CI form 'best practices' - by El Forum - 08-05-2009, 01:45 AM
CI form 'best practices' - by El Forum - 08-05-2009, 01:46 AM
CI form 'best practices' - by El Forum - 08-05-2009, 02:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB