Welcome Guest, Not a member yet? Register   Sign In
Collect and Validate POST data (Form_validation extension)
#1

[eluser]bryantAXS[/eluser]
Hey all,

I have a custom MY_Form_validation extension that I've used on many projects. I'm posting it because it has come in real handy to me and I figure other people may like it as well. There are a few other methods I've added but the one I use the most is the getFormData() method.

The getFormData() method takes in an array as a parameter that can either be a list of all the required fields (by name attribute), or it can be an associative array (keyed with 'required' and 'notRequired' with respective strings that list the element names). The method will return you an array with the keys 'valid': boolean if all the correct data was supplied, 'fields': a key/value array that holds all of the various pieces of data, and 'notValid': an array of elements that were required and not provided.

its a pretty straight forward idea, but its saved me lots of time

any critiques or modifications are welcomed Smile




Theme © iAndrew 2016 - Forum software by © MyBB