Welcome Guest, Not a member yet? Register   Sign In
form validation: remove and add an output 'field'
#1

[eluser]Unknown[/eluser]
I was reading the 2.0 manual on form validation and I'm missing something. Imagine if you will:

I have a form for unauthenticated visitors: Username, Password, Comment. For authenticated users, the first two fields aren't necessary, because a user is known. The Username and Password fields, aren't used in the storage of the comment, but a user_id is. In case of an authenticated user, that's no problem, but for unauthenticated people, it means altering the form after submitting: depending on Username and Password an output field user_id is created and filled and the fields Usenrame and Password are removed from the 'output list'.

In both cases of the form (authenticated and unauthenticated) the output must be the same: user_id & comment.

How would I do this with the CI form validator? Thanks.

PS. In the 2.0 form validator manual, there's no output list... The data is trimmed and md5'ed, but not used after that. Where is the prepped data??




Theme © iAndrew 2016 - Forum software by © MyBB