CodeIgniter Forums
form validation no loading page view required - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10)
+--- Thread: form validation no loading page view required (/showthread.php?tid=66660)



form validation no loading page view required - jaysondotp - 11-18-2016

Hi Everyone,

in my form validation, i don't want to load the whole html page, to trigger error, but i do not have idea how to do.

Code:
    if($this->form_validation->run() == false)
        {                            
        echo form_error('dblone_bc');
            }

 code above is work well, but when i convert the form_error('dblone_bc'); into variable so that i can pass the data into view but sad to say everything not work.   

please advise..


RE: form validation no loading page view required - Paradinight - 11-19-2016

(11-18-2016, 06:28 PM)jaysondotp Wrote: Hi Everyone,

in my form validation, i don't want to load the whole html page, to trigger error, but i do not have idea how to do.

Code:
if($this->form_validation->run() == false)
   {
echo form_error('dblone_bc');
           }

 code above is work well, but when i convert the form_error('dblone_bc'); into variable so that i can pass the data into view but sad to say everything not work.   

please advise..
How about:

Code:
$data['form_error'] = form_error('dblone_bc');

form_error return a string