using jquery and ajax how to insert text box value in database in cake php? -
how can insert text box value in database using jquery , ajax in cake php ? have tried lot not success.
you can handle this:
ajaxurl controller/action
$.ajax({ type : "post", url : ajaxurl data: {"input1" : $("input[name='text-box']").val()} }).done(function(data){ console.log(data); });
then in controller
public function action(){ $this->autorender = false; $this->request->onlyallow('ajax'); $input = $_post["input1"]; //do database input here homecoming suceess/failure;
}
jquery ajax cakephp
No comments:
Post a Comment