开发者

Call controller function on button clik isn't working

开发者 https://www.devze.com 2023-02-13 16:52 出处:网络
I want to call controller function named as CreateData() on submit button click,but its not working. here is my code.

I want to call controller function named as CreateData() on submit button click,but its not working.

here is my code.

<form method="post" >
<input type="submit"  value="CREATE" name="开发者_如何学Cbtncreate" id="btncreate" />        
</form> 

function CreateData(){    
   if($this->input->post('btncreate'))
      $this->load->view('demo');
}  


You forgot 'action' attribute:

<form method="post" action="your_controller/CreateData" >
<input type="submit"  value="CREATE" name="btncreate" id="btncreate" />        
</form> 

function CreateData(){
   $this->load->view('demo');
}  
0

精彩评论

暂无评论...
验证码 换一张
取 消