<?php
echo $this->Form->button('A Button');
echo $this->Form->button('Another Button', array('type'=>'button'));
echo $this->Form->button('Reset the Form', array('type'=>'reset'));
echo $this->Form->button('Submit Form', array('type'=>'submit'));
?>
Which should i use among them?
I will click a button and the jquery ajax code will be executed.
The whole page will not be reloaded/refreshed.
Only the part of that division will be reloaded and the result getting from database will be displayed .
I have added a division , it’s for Poll.
There is a question and four answers.
One can select one radio button and click the button then the result from database will be displayed in that division.
How can i do this with jQuery ajax ?
The jQuery ajax format is like that =>
$.ajax({
type: "POST",
url: "some.php",
data: "name=John&location=Boston",
success: function(msg){
alert( "Data Saved: " + msg );
}
});
So how can i call an action of a controller with this format ?
Thanks in advance.
If you don’t want to reload the page, then go with one of these: