AGILETOOLKIT :: js()->..->execute() must be used in response to form submission or AJAX operation only

StackOverflow https://stackoverflow.com/questions/20182704

Question

I am getting this error when i do form submit.

Application Error

here is my code: View

 class View_Tabs_Activities extends View {
    function init() {
    parent::init();

    $f = $this->add('Form', null, 'PostForm');
    $f->setModel('Post');
    $f->addSubmit();
}
function defaultTemplate() {
    return array('view/tabs/activities');
}
}

HTML

<div class="tab-pane active" id="shareTab">
            <div class="share">
                <?$PostForm?>
            </div>
        </div>

Here is something that i found by checking the console:

enter image description here

Était-ce utile?

La solution

The problem was that there were 2 jQuery files included in the same html page that is why $.atk4 was undefined. I removed the 2nd one and its working fine now.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top