Im trying to create a simple Ajax form for a message board in a CakePHP application, but I can\'t for the life of me figure out how to properly use the Js->submit() function
What happens is that it loads the default layout. You'll have to change the layout to ajax with the following line:
$this->layout = 'ajax';
You insert that line inside your isAjax() condition.
Also your options array has the wrong format. The action key should be inside the url key.
$this->Js->submit('Post Your Message', array(
'url' => array(
'action' => 'add'
),
'update' => '#message_board'
)
);