Hi Bruno,
If you could bear with me and kindly explain how exactly "[~yourajaxdocumentwithshowchunksnippet~]" works.
First I presume the showchunk snippet in #2 still works?
I then created a blank document (#40) with with these (blank, uncache and unpublised) :
[!showchunk!]
{{chunk1}} <--- not sure if this is correct way to call my chunks
{{chunk2}} <---
{{chunk3}} <---
The page uses jQuery but I have the mootools conflict covered, and I have this:
var ajax_url = ’[~40~]’;
But none of the chunk doesn’t
get loaded when selected.
A side note, I actually prefer to use jQuery and I was able to retrieve aJax data correctly with a jQuery call like this:
function loadContent(id) {
jQuery("#formcontainer").load("[(base_url)]loadchunk.php?o="+id+"");
}
"loadchunk" is located outside MODx but in the same server. This workaround is because I don’t know how to retrieve chunk from above jQuery call.
The code looks like this:
<?php
$cOption = $_GET[’o’];
switch($cOption) {
case 1:
echo ’chunk 1’;
break;
case 2:
echo ’chunk 1’;
break;
case 3:
echo ’chunk 3’;
}
?>
Problem with
this method that, I am unable to get eForm validation for the above chunks due to Ajax calls. I am also wondering if the validation works with your method.