Welcome Guest, Not a member yet? Register   Sign In
How to custom or to change the input file error message ?
#1

[eluser]ludo31[/eluser]
Hello ;

I can custom error message for a simple input :
for example
Code:
$this->form_validation->set_rules('titre', 'lohateny','callback_titrecheck');


   public  function titrecheck ($str)
{
       /* si le titre est vide */
       if(isset($str)){
            
               // il n'est pas vide
              return true ;
       }
       else
       {
              
               $this->form_validation->set_message('titrecheck', ' %s tsy feno na tsy ara-dalana');
              return false ;
       }
}

but for the input file where we upload file I don't know how to change the message :

I try something like this :

Code:
if(!$this->upload->do_upload())
                     {
                          $data['error_upload']=$this->upload->display_errors();
                          // $this->load->view('annonce/annonce_vue',$data);
                          
                            $data['content']='annonce/annonce_vue';
                         $this->load->view('template/templateAnnonce',$data);
                     }
it works we we don't upload any files or the type was wrong but I would like the message because it is in english !!

Code:
You did not select a file to upload.

is it possible to do that

thanks
#2

[eluser]CroNiX[/eluser]
Read the docs for language files. That particular file (that you would want to translate after reading how in the docs) is /system/language/english/upload_lang.php
#3

[eluser]ludo31[/eluser]
thanks a lot !!




Theme © iAndrew 2016 - Forum software by © MyBB