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');
}
精彩评论