Welcome Guest, Not a member yet? Register   Sign In
best practices on Form Reuse - keeping all forms in a central location with validation
#45

[eluser]chuckleberry13[/eluser]
@JoostV - Sorry I misunderstood your library then. I'll take a closer look Wink.

@randy - Thanks that did make a lot more sense. The Business analogy was very clear as to the reason form elements need to be validated and not forms.

So you mentioned the data model should be the source for the form elements. This makes intuitive sense from the stand point that eventually forms fields will be sent to the data model to be saved into a db. But could you expound a little on how this should best be done?

Right now I take the $_POST array, iterate through it to clean up some of the number fields, make sure I only grab fields that were filled out (not blank) and then send that array to my data model which in turns saves it in the db. Are you saying the data model should have listed out each field, and the form is populated from that?

Thanks in advance Randy for taking your time to enlighten me and other newbies participating in the forums.

p.s. sidenote I just discovered ExtJS and saw in some other posts that you are familiar with it. This is off topic for this thread, but I would love to get some pointers from you on how to best work with ExtJS and CI. I currently use JQuery a lot, but nothing more than just including JS files in the header views and using an Ajax controller that handles some of the Ajax requests. I have an eerie feeling there is a better way Wink.


Messages In This Thread
best practices on Form Reuse - keeping all forms in a central location with validation - by El Forum - 07-26-2008, 01:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB