I want to alter element when form is submitted without sending ajax request. And can’t figure out how to write it properly and generate code that I want.
In cakePHP view I have:
$this->Js->get('#testForm')->event('submit', $this->Js->get('#fastRegisterForm')->effect('show'));
And it generates:
$(document).ready(function () {
$("#fastRegisterForm").bind("submit", function (event) {
$("#fastRegisterForm").show();
return false;
});
});
And I want to have:
$(document).ready(function () {
$("#testForm").bind("submit", function (event) {
$("#fastRegisterForm").show();
return false;
});
});
I think you should setup it in a different way.
Cake might be getting “confused” when you call another
js->getinside of ajs->get