The50
The50

Reputation: 1168

October CMS AJAX actions - plugin

What could be the problem if I get this error when I try to call an AJAX action?

Invalid handler name. The correct handler name format is: "onEvent"

I am trying to use contact form plugin and it's not working because of this AJAX call error. I included {% framework %} and {% framework extras %} in my main template at the very bottom, right after the jQuery includes. I use the contact form in another partial which is included in that main template. Any ideas?

Upvotes: 1

Views: 2198

Answers (2)

Manoj Rammoorthy
Manoj Rammoorthy

Reputation: 1430

So in october cms the ajax handlers names should be onName example

<button data-request="onGallery" >Go</button>

and in Ajax handler

public function onGallery()

{

     flash::success('hi');

}

according to the document all the handlers should have on preceding the name of the function

Upvotes: 1

Jurgen Schmidt
Jurgen Schmidt

Reputation: 46

From the docs:

Handler names should have the following pattern: onName

Is your handler name following that pattern?

Upvotes: 3

Related Questions