Welcome Guest, Not a member yet? Register   Sign In
error with form validation
#1

[eluser]alaminx[/eluser]
i have a code :
Code:
function doregister_doanhnghiep()
        {
        //set config for paging
            
            $this->load->library('validation');
            $rule['txtEmail'] = "trim|required|min_length[5]|max_length[12]|xss_clean";
            $this->validation->set_rules($rule);
                
            if ($this->validation->run() == FALSE)
            {
                $data['title']            ='List all doanh nghiep';
                $data['base_url']        =$this->config->item('base_url');
                $this->load->view('quanli/doanhnghiep/register_doanhnghiep',$data);
            }
            else
            {
            
        //get infomation from form
            $data1['email']=$this->input->post('txtEmail');
            $data1['password']=$this->input->post('Password');
            $data1['role']=7;
            $data2['tendoanhnghiep']=$this->input->post('txtTendoanhnghiep');
            $data2['linhvuc']=$this->input->post('txtLinhvuc');
            $data2['diachi']=$this->input->post('txtDiachi');
            $data2['country']=$this->input->post('cbxCountry');
            $data2['city']=$this->input->post('cbxCity');
            $data2['district']=$this->input->post('cbxDistrict');
            $data2['websites']=$this->input->post('txtWebsites');
            $data2['daidien']=$this->input->post('txtDaidien');
            $data2['chucvu']=$this->input->post('txtChucvu');
            $data2['dt']=$this->input->post('txtDt');
            $data2['fax']=$this->input->post('txtFax');
            $data2['detail']=$this->input->post('txtDetail');
        //insert data to database
            $this->doanhnghiep_model->insert($data1,$data2);
            redirect('quanli/list_doanhnghiep');
            }
        }
my view page:

Code:
<td width="38%"><label>Email đăng nhập:</label></td>
      <td width="62%">&lt;input type="text" name="txtEmail" maxlength="40" /&gt;&lt;/td>
      </tr>
        <tr>
            <td><label>Xác nhận email:</label></td>
             <td>&lt;input type="text" name="txtconEmail" maxlength="40" /&gt;&lt;/td>
        </tr>
        <tr>
            <td><label>Password:</label></td>
            <td>&lt;input type="password" name="Password" maxlength="40"/&gt;&lt;/td>
        </tr>
        <tr>
            <td><label>Xác nhận Password:</label></td>
            <td>&lt;input type="password" name="conPassword" maxlength="40"/&gt;&lt;/td>
        </tr>
  </table>
  </fieldset>
    <fieldset style="margin-left:10%;width:80%">
    <legend style="margin-left:30%">Thông tin đăng kí:</legend>
        <table width="73%"  border="0"  style="margin-right:0%;margin-left:18%">
<tr>
                <td width="38%"><label>Tên công ty:</label></td>
              <td width="62%" >&lt;input type="text" maxlength="40" name="txtTendoanhnghiep" /&gt;&lt;/td>
          </tr>
            <tr>
                <td><label>Lĩnh vực hoạt động:</label></td>
                <td>&lt;input type="text" maxlength="40" name="txtLinhvuc" /&gt;&lt;/td>
            </tr>
            <tr>
AND HERE IS THE ERROR:
An Error Was Encountered

Unable to load the requested language file: language/validation_lang.php
#2

[eluser]manilodisan[/eluser]
system/language/validation_lang.php. See if that file is present there....
#3

[eluser]LuckyFella73[/eluser]
Looks like you have defined a language in application/config.php
that is not available in system/language/(your language)

Did you allready check this?
#4

[eluser]xwero[/eluser]
As i look at your labels it's not English Wink So is suspect you have set the default language to your own in the config.php file. If you have not copied the validation_lang.php file to the application/language/[idiom] directory the language library will not find the file.
#5

[eluser]alaminx[/eluser]
problem is solved. thank for help




Theme © iAndrew 2016 - Forum software by © MyBB