This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
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() { ... }
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.
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