I am new to cakephp and I want to implement Ajax on my homepage.
I have three modules on my page (client, developer and project). I want to add ajax link. It only works fine on the index page.
My code is:
<h2>Projects</h2> <div class="clear"></div> <ul> <li title="Project List"> <?php echo $ajax->link('Projects List', array("controller" => "projects", "action" => "index"), array( 'update' => 'main_page' ));?> </li><br /> <li title="Add New Project"> <?php echo $ajax->link('Add New Project', array("controller" => "projects", "action" => "add"), array( 'update' => 'main_page' ));?> </li> </ul>
Now my first problem is that on the add form, checking with js does not work.
Secondly: if I use the built-in cakephp validation, then it validates my form, but redirects the page to "admin / projects / add" if the data is not inserted.
The third problem is that when the above case happens, and I want to redirect to the list page via my ajax link, at that time it also does not work.
source share