Welcome Guest, Not a member yet? Register   Sign In
[Solved] Tooltip not show when form error codeigniter
#4

I have now solved it

On script I have had to use .tooltip('show') like


PHP Code:
$(function () {
 
   $('input[name=title]').tooltip({
 
       placement"right",
 
       container:'body',
 
       title'<?php echo $error_title;?>',
 
       /*trigger: "hover"*/
 
   }).tooltip('show');
}); 


And on controller

Change the form error around


PHP Code:
public function index() {
    
        
$this->data['error_title'] = '';
    
        if (
$this->input->post('title')) {
            
$this->data['title'] = $this->input->post('title');
        } else {
            
$this->data['title'] = '';
        }

        if (
$this->input->post('message')) {
            
$this->data['message'] = $this->input->post('message');
        } else {
            
$this->data['message'] = '';
        }

        
$this->form_validation->set_rules('title''title''trim|required|min_length[15]|max_length[100]');
        
$this->form_validation->set_rules('message''message''trim|required|min_length[15]');

        if (
$this->form_validation->run() == false) {

            
$this->data['error_title'] = form_error('title'' '' ');

            
$this->data['children'] = array(
                
'common/header',
                
'common/navbar',
                
'common/footer'
            
);

            
$this->load->render('question/ask'$this->data);

        } else {
            
        }
    } 
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
RE: Tooltip not show when form error codeigniter - by wolfgang1983 - 03-10-2017, 05:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB