Hello MODXers,
We are building our first websites in MODX Revolution and encounter a small problem with the FormIt snippet.
In MODX-Revolution we used the eForm snippet. The examples on eForm showed that you had to define three chunks (Form, Report and Thanks) and they work together in the process. In each Chunk you can put HTML code which will not be interpreted.
In the ’Thanks’-chunk we put Google Adwords Conversion Codes to signal Google Adwords that a Sale is done. That code looks like this:
<!-- Google Code for Vraag een demo aan Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 9999999999;
var google_conversion_language = "nl";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "XXXXXXXXXXXX";
var google_conversion_value = 0;
/* ]]> */
</script>
(and some more Javascript code...)
in MODX Revolution we use FormIt.
the call looks like this:
[[!FormIt?
&hooks=`email`
&emailTpl=`requestDemoReport`
&emailFrom=`[email protected]`
&emailTo=`[[$emailAddress?]]`
&emailSubject = `Email subject`
&successMessage = `[[$requestDemoThanks?]]`
&successMessagePlaceholder = `success`
&validate=`title:required,
name:required,
company:required,
email:required,
]]
As you can see, the successmessage is a call to the Thanks-chunk.
But in Revolution, code in that chunk is also interpreted by the MODX-tag-processor.
And in the Google Conversion Code there is the following line:
Reason for this code is here:
http://javascript.about.com/library/blxhtml.htm
On the screen we get weird results because of the MODX-tag-interpreter wich picks up the ’]]’ in the Google Conversion Code.
A solution might be a redirect to a new page but we really don’t want that because the forms are part of the page and then we need to duplicate the page.
Does anybody have a solution for this?
Thanks,
Bert Catsburg