&event=ajax&format=raw

rmpaolillo 05 May, 2015
Hello Max,

one of my challenging tasks at the moment is "migrate" all my old forms written with CF4 to CF5.

In one of my forms I have noticed a substancal difference:

when I create a custom event (say I call it "ajax") and I try to recall it from another form to output ajax formatted data, when I use a call &event=ajax&format=raw in a form written in CFv4 I get a raw formatted json object as expected.

[code]
{"data":[{"cf_id":"12","cf_uid":"2ba35fc1c07e7900c…
[/code]

When the custom event (called ajax) is written in CFv5 and it is call it from another form I receive a bad formatted jason raw data since there is the DOM <div class="gbs3">....</div> surrounding the data object.

[code]
<div class="gbs3">
{"data":[{"cf_id":"12","cf_uid":"2ba35fc1c07e7900c…
</div>
[/code]

Is there any particular reason for this or it is a bug?

For me it is not a real issue since I can still use CFv4 form to make things work, but I guess this needs to be sorted out.

Regards.

Marco
GreyHead 05 May, 2015
Hi Marco,

Please try adding this at the end of the Ajax event code
// . . . last ajax line here
$form->stop = true;
return false;
?>

The $form->stop= true; line should stop any further processing and block the extra div.

Bob
rmpaolillo 05 May, 2015
Hi Bob,

I did try your code but still the following output:

[code] <div class="gbs3">
{"data":[{"cf_id":"12","cf_uid":"2ba35fc1c07e7900c…
</div>[/code]
Max_admin 13 May, 2015
Answer
1 Likes
Please try:
&tvout=ajax
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rmpaolillo 13 May, 2015

&event=ajax&tvout=ajax


Yes this answers my question.

Many thanks to Bob and you.

Marco
This topic is locked and no more replies can be posted.