This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

ADH
ADH

I built a modal form in a 'partial'. My problem is that when I hit the submit button to trigger the PHP code in the same partial using Ajax I get an error saying that "Ajax Handle function onSubmitMembershipRegistration() was not found" (see code below). However, when I drop the same code in their respective Markup and Code on a 'page', then it works perfectly fine. Anyone know why this could be?

In The Partial...

MARKUP <form data-request="onSubmitMembershipRegistration" data-request-validate data-request-flash> .... </form>

CODE function onSubmitMembershipRegistration() { ... }

mjauvin
mjauvin

Is that on the backend or front-end? Component or CMS page?

ADH
ADH

Let's see, I'm seeing the error on the front-end.

Ajax finds the PHP function fine when the code is on a CMS page, but when I put the same code in the partial, Ajax can't find it.

mjauvin
mjauvin

Are you using the partial in a component?

If so, you need to prepend the ajax handler name with the component name/alias as documented here:

https://octobercms.com/docs/plugin/components#referencing-self

1-4 of 4

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.