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

KurtJensen
KurtJensen

AJAX Call to second component on same page fails to call its methond despite different alias names.

See: https://github.com/firemankurt/AjaxColorTest

KurtJensen
KurtJensen

Thanks to Scottbedard for pointing out that my AJAX call was the issue.

My original code:

<form method="POST" 
   data-request="onChangeColor" 
   data-request-update="'{{__SELF__}}::main':'#target-{{ __SELF__.Color }}'">

      <button type="submit" class="btn btn-default">Change Color</button>
</form>

Should have been:

<form method="POST" 
   data-request="{{ __SELF__ ~ '::onChangeColor' }}" 
   data-request-update="'{{__SELF__}}::main':'#target-{{ __SELF__.Color }}'">

      <button type="submit" class="btn btn-default">Change Color</button>
</form>

Thanks Scott

Last updated

1-2 of 2

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