Welcome Guest, Not a member yet? Register   Sign In
Loading the form and validating in the same function?

Duh! And I thought through some magic trick I'd never come to understand, this code example I saw on the net works like a charm! Smile

Thanks a lot, and sorry for causing you all frustration.

[eluser]Ivan A. Zenteno[/eluser]
But why your controller is like that? I mean the controllers is like then:

function foo()
    $rules = array('THE RULES HER');
       //foo true
       //var false

Yes, I read that piece of code I wrote (well, something like that) somewhere on the Internet. I assumed the rules have to be set only when the page is loaded as a form, and therefore, the strange form you saw. It is fixed now, though.

If you'd like to see a working example of form validation and posting to the same method, you might check out the add_category method on this page:


Thanks! A great tip. Smile

Theme © iAndrew 2016 - Forum software by © MyBB