• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Form not submitting data

#5
(09-05-2018, 04:23 PM)php_rocs Wrote: @majortom84,

Interesting, you are using...  
if( empty( $this->input->post() ) )
instead of...
if ($this->form_validation->run() == FALSE)

Any reason why?


assume that u need to show alert when validation failed
and you submit your form to the same url where you view the form (which is common way in CI):
PHP Code:
public function foo()

    {
 
           if($this->form_validation->run()){
 
           }else{
//set alert
 
               $this->postal->add('failed to validate!''error');
 
           }

then every time you open link you will see error alert because u did not submit anything. That's why you need first check if something posted or not.
Reply


Messages In This Thread
Form not submitting data - by majortom84 - 09-05-2018, 12:51 PM
RE: Form not submitting data - by kierownik - 09-05-2018, 04:22 PM
RE: Form not submitting data - by majortom84 - 09-06-2018, 06:36 AM
RE: Form not submitting data - by php_rocs - 09-05-2018, 04:23 PM
RE: Form not submitting data - by neuron - 09-05-2018, 11:06 PM
RE: Form not submitting data - by neuron - 09-05-2018, 10:58 PM
RE: Form not submitting data - by Wouter60 - 09-06-2018, 02:48 AM
RE: Form not submitting data - by InsiteFX - 09-06-2018, 09:13 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.