Hey fellows I’m kinda stuck here. I created a chunk which includes a form in which you punch in some values and an external PHP script draws the datasets from the mysql db. Works fine but the result is displayed in a blank window that loads in place of the website after hittting the submit button. But I want the result dispayed in the same place where the chunk was previously displayed/inserted. I already tried target="_self", names of divs, wrapping the form in a <div id...> in the chunk, wrapping the chunk call in it etc. but I just can’t get it to work and I just can’t find any post that can provide an answer....
Thank’s a lot in advance!
-
☆ A M B ☆
- 24,524 Posts
That’s what AJAX is good for. The external .php script still does the processing, but its results are (usually) encoded as JSON, and the AJAX script on the original page inserts it into the existing page without a reload. You can even have the php code in a snippet, and call the snippet in a document with no template and no other content than the snippet call. That way your php code can access all the MODx APIs.