Welcome Guest, Not a member yet? Register   Sign In
FreakAuth Validation :-Please Help Me !!!
#1

[eluser]Unknown[/eluser]
Hi Guys,


I am new to CI.


I have to add some more fields to the registration form of the freakauth. I have successfully added text fields. But when I go for the validation it is showing error. I have used the MyFALVal class for the validation and my validation method is:

function firstname_check($value)
{

$callback = 'firstname_check';
return $this->is_valid_text($callback, $value,
$this->CI->config->item('FAL_first_name_min'), $this->CI->config->item('FAL_first_name_max'));

}
I have copied this from the username validation provided.


and I have used :

<!--FIRST NAME-->
<p><label for="first_name">&lt;?=$this->lang->line('FAL_first_name_label')?&gt;:</label>
&lt;?=form_input(array('name'=>'first_name',
'id'=>'first_name',
'maxlength'=>'45',
'size'=>'45',
'value'=>(isset($this->fal_validation) ? $this->fal_validation->{'first_name'} : '')))?&gt;
&lt;?=(isset($this->fal_validation) ? $this->fal_validation->{'first_name'.'_error'} : '')?&gt;
</p>

in the form section.


then there is an error showing :

First Name:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: MyFALVal::$first_name

Filename: forms/register.php

Line Number: 15

It will be a great help if somebody tell me how can I fix the same ..?

This is something urgent and any help will be appreciated.Please help me !!!!

I just want to add the first name and the last name to the registration form. It will be helpful if somebody tell me how can I insert this values to the database and can displayed in the Admin homepage..?

Please help me ...this is very very urgent !!!!
#2

[eluser]thomasz[/eluser]
I have some experience with Freakauth but not significant so i'll just shoot from the hip here...

In your controller you have to register the fields and the rules that you will be validating.

So you will need:
[... other fields ...]
$fields['first_name'] = 'First Name';
$this->fal_validation->set_fields($fields);


and then the rules...
[... other rules ...]
$rules['first_name'] = 'trim|required';
$this->fal_validation->set_rules($rules);




Theme © iAndrew 2016 - Forum software by © MyBB