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
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
Hi Marco,
Please try adding this at the end of the Ajax event code
The $form->stop= true; line should stop any further processing and block the extra div.
Bob
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
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]
I did try your code but still the following output:
[code] <div class="gbs3">
{"data":[{"cf_id":"12","cf_uid":"2ba35fc1c07e7900c…
</div>[/code]
Please try:
&tvout=ajax
&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.