I could be missing something severely here, but this is just not adding up.
I built an ajax form which is working perfectly fine with ProtoType.
I am migrating to Jquery, and so I added the jquery libraries etc..
Below is my $ajax submit.. NOTE the jQuery coded loading and success options..
What I cannot figure out is WHY WHY WHY does this work perfectly fine but ONLY if I include the ProtoType and Scriptulaous libraries???? This makes absolutely no sense to me because I am calling my loader with jQuery .show().. Why would ProtoType have any effect on this??
The submit section of my form
echo $ajax->submit('Submit', array('url' => array('controller' => 'plans', 'action' => 'search_action_ajax'),
'update' => 'ajax_search_div',
'label' => 'Get Quotes >>',
'id' => 'submitButton',
'loading' => '$j("#busy-indicator").show()',
'success' => '$j("#busy-indicator").hide()',
));
I just want to disable ProtoType altogether..
My controller helper is as follows:
var $helpers = array('Js' => array('Jquery'), 'Ajax', 'Html', 'Form', 'Session');
As you can see I am calling in jQuery.
My libraries in my default.ctp
echo $this->Html->script('jquery-1.6.1.min', array('inline' => 'false'));
echo $this->Html->script('jquery-ui-1.8.13.custom.min', array('inline' => 'false'));
Side note:
I also tested the script with the below just to ensure the jQuery was in fact processing:
...'loading' => '$j("#busy-indicator").fadeIn("slow")',...
the AJAX-Helper is deprecated, you shouldn’t use it anymore.
Also, you don’t need to specify that you want to use jQuery since this is the default library which will be loaded by CakePHP as you can read here. This doesn’t mean it also gets included! Only the helper will be ready to use it.
You still can use AJAX, but you need to rewrite your views. You can get the information about how to do that on the manual page for Js-Engine Usage.
I would also recommend you to read the whole manual-page on the Js-Helper.