We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10208 ☆ A M B ☆
    • 1,780 Posts
    I've tried both SPForm and Formit. When I put the snippet call into the resource, everything shows up as it should. Yet I get duplicate forms appearing above the header. In fact, I get two duplicates above the <header>. So there's three forms appearing on the page.

    The header area is contained in a header chunk called in the template, forms snippet calls are inserted (once) in the document content area. SPForm does it, as does Formit.

    WTHeck? There's nothing between the <head> and the <header> where these extra forms appear. Why would they both just plant themselves there without my approval? Such naughty forms!

    Revo 2.2.0-pl
    MODX Boilerplate
      Frogabog- MODX Websites in Portland Oregon
      "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
      Having server issues? These guys have MODX Hosting perfected - SkyToaster
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      One reason I fell in love with working with computers. Unlike teenaged children, they always do precisely what you tell them to do. Sometimes the trick is to figure out just what you (or those whose scripts and libraries you are using) did tell them to do.

      I have on occasion accidentally had something in the content that duplicated the content. What does the view source for the page look like? What does your template look like? The Javascript?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 10208 ☆ A M B ☆
        • 1,780 Posts
        LOL Susan, that's exactly what I've said a thousand times over the years when people claim magic and mystery has taken hold of their computer and beg me to break the spell.

        Many of those people also think I should remember their passwords... :~?

        I'd woken in the night after dreaming that my toe was produced 3 times by a snippet and posted. I realized I forgot to mention that I knew something was causing it and it wasn't magic but when I tried to check the source again, I received 404 errors on everything but index.html on the static site, no manager, couldn't connect via ftp, and cpanel showed no files whatsoever. On all domains. I knew I didn't do it, I was asleep. But I did wonder if one of the kids might have... haha...

        It was actually some kind of server maintenance I discovered finally and then everything was back up like nothing ever happened. Unfortunately 2am maintenance central time translates to midnight pacific time which isn't always convenient. Alas, definitely not magic and mystery.
        At any rate, here's the area where the form appears. First, is the actual code from the header chunk file, and following that is what the source shows.

        Thanks very much for any help. I see where it's happening but I have no clue why.

        <meta name="description" content="[[*introtext:empty=`[[*content:strip_tags]]`:limit=`200`]]">
        	<meta name="author" content="[[If? &subject=`[[*publishedby]]` &operator=`>` &operand=`0` &then=`[[*publishedby:userinfo=`fullname`]]` &else=`[[*createdby:userinfo=`fullname`]]`]]" />
        	<meta name="keywords" content="" />


        Results:
        <meta name="description" content="
        <div id="spf_form">
        <form action="contact/rent/spformtest.html" method="post" onsubmit="return checkform(this);">
          <input type="hidden" name="keyCount" id="keyCount" value="" /><script type="text/javascript"> /* <![CDATA[ */ var keysPressed = 0;
        document.onkeypress = logKeys;
        function logKeys() {
        	keysPressed++;
        	document.getElementById("keyCount").value = keysPressed;
        }
         /* ]]>  */ </script>
          <input type="hidden" name="mouseTravel" id="mouseTravel" value="" /><script type="text/javascript"> /* <![CDATA[ */ var myInterval = window.setInterval(timedMousePos,250);
        var xPos = -1;
        var yPos = -1;
        var firstX = -1;
        var firstY = -1;
        var intervals = 0;
        function getMousePos(p) {
        	if (!p) var p = window.event;
        	if (p.pageX || p.pageY) {
        		xPos = p.pageX;
        		yPos = p.pageY;
        	}	else if (p.clientX || p.clientY) {
        		xPos = p.clientX + document.body.scrollLeft	+ document.documentElement.scrollLeft;
        		yPos = p.clientY + document.body.scrollTop + document.documentElement.scrollTop;
        	}
        }
        function timedMousePos() {
        	document.onmousemove = getMousePos;
        	if (xPos >= 0 && yPos >= 0) {
        		var newX = xPos;
        		var newY = yPos;
        		intervals++;
        	}
        	if (intervals == 1) {
        	  firstX = xPos;
          	firstY = yPos;
        	} else if (intervals == 2) {
          	clearInterval(myInterval);
          	calcDistance(firstX,firstY,newX,newY);
          }
        }
        function calcDistance(aX,aY,bX,bY) {
        	var mouseTraveled = Math.round(Math.sqrt(Math.pow(aX-bX,2)+Math.pow(aY-bY,2)));
        	try	{
        		document.getElementById("mouseTravel").value = mouseTraveled;
        	}
        	catch(excpt) { }
        }
        function dummy() {} /* ]]>  */ </script>
          <div class="spform_input">Please refrain from entering<br /> your Last Name here: <input type="text" name="Last__Name" size="30" /></div>
          <div class="spform_normal_input"><input type="hidden" name="tmStart" value="1328080320" /></div>
          
         <div class="spf_recipient"><input type="hidden" name="whoto" value="Webmaster" />
        </div>
        <div class="spf_input_pair">
        <span class="spf_block_prompt"> Your name: </span>
        <span class="spf_normal_input"><input type="text" id="name" name="name" size="30" /></span>
        </div>
        <div class="spf_input_pair">
        <span class="spf_block_prompt"> Email address: </span>
        <span class="spf_normal_input"><input type="text" id="email" name="email" size="30" /></span><br />
        </div>
        <div class="spf_input_pair">
        <span class="spf_block_prompt">Subject: </span>
        <span class="spf_normal_input"><input type="text" id="subject" name="subject" size="30" /></span><br />
        </div>
          
        <div class="spf_block_prompt">Please enter your comments below.  Click "Submit" when done.:</div>
        <div class="spf_textarea">
        <textarea name="comments" rows="10" cols="50"></textarea>
        </div>
        <div class="spf_buttons"><input type="submit" name="s" value="Submit" /> 
        </div>
        </form>
        </div>">
        	<meta name="author" content="Kori Rush" />
        <meta name="keywords" content="" />
        		<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
        	<script type="text/javascript"
              src="http://maps.googleapis.com/maps/api/js?key=AIzaSyAsOuAML3mvmg7NG2OjeeoPzu1SbCN9MHM&sensor=true">
        	<!-- https://developers.facebook.com/docs/opengraph/ -->
        	<meta property="og:title" content="spformtest - Trillium Lake Basin Cabins - Mt. Hood Cross-Country Ski & Snowshoe Rental Cabin"/> 
            <meta property="og:type" content=""/> <!-- https://developers.facebook.com/docs/opengraph/#types -->
            <meta property="og:url" content="http://clients-site.com/barlowmdx/contact/rent/spformtest.html"/>
            <meta property="og:image" content=""/>
            <meta property="og:site_name" content=""/>
            <meta property="fb:admins" content="USER_ID"/> <!-- set your facebook user / app-ID here -->
            <meta property="og:description" content="
        <div id="spf_form">
        <form action="contact/rent/spformtest.html" method="post" onsubmit="return checkform(this);">
          <input type="hidden" name="keyCount" id="keyCount" value="" /><script type="text/javascript"> /* <![CDATA[ */ var keysPressed = 0;
        document.onkeypress = logKeys;
        function logKeys() {
        	keysPressed++;
        	document.getElementById("keyCount").value = keysPressed;
        }
         /* ]]>  */ </script>
          <input type="hidden" name="mouseTravel" id="mouseTravel" value="" /><script type="text/javascript"> /* <![CDATA[ */ var myInterval = window.setInterval(timedMousePos,250);
        var xPos = -1;
        var yPos = -1;
        var firstX = -1;
        var firstY = -1;
        var intervals = 0;
        function getMousePos(p) {
        	if (!p) var p = window.event;
        	if (p.pageX || p.pageY) {
        		xPos = p.pageX;
        		yPos = p.pageY;
        	}	else if (p.clientX || p.clientY) {
        		xPos = p.clientX + document.body.scrollLeft	+ document.documentElement.scrollLeft;
        		yPos = p.clientY + document.body.scrollTop + document.documentElement.scrollTop;
        	}
        }
        function timedMousePos() {
        	document.onmousemove = getMousePos;
        	if (xPos >= 0 && yPos >= 0) {
        		var newX = xPos;
        		var newY = yPos;
        		intervals++;
        	}
        	if (intervals == 1) {
        	  firstX = xPos;
          	firstY = yPos;
        	} else if (intervals == 2) {
          	clearInterval(myInterval);
          	calcDistance(firstX,firstY,newX,newY);
          }
        }
        function calcDistance(aX,aY,bX,bY) {
        	var mouseTraveled = Math.round(Math.sqrt(Math.pow(aX-bX,2)+Math.pow(aY-bY,2)));
        	try	{
        		document.getElementById("mouseTravel").value = mouseTraveled;
        	}
        	catch(excpt) { }
        }
        function dummy() {} /* ]]>  */ </script>
          <div class="spform_input">Please refrain from entering<br /> your Last Name here: <input type="text" name="Last__Name" size="30" /></div>
          <div class="spform_normal_input"><input type="hidden" name="tmStart" value="1328080320" /></div>
          
         <div class="spf_recipient"><input type="hidden" name="whoto" value="Webmaster" />
        </div>
        <div class="spf_input_pair">
        <span class="spf_block_prompt"> Your name: </span>
        <span class="spf_normal_input"><input type="text" id="name" name="name" size="30" /></span>
        </div>
        <div class="spf_input_pair">
        <span class="spf_block_prompt"> Email address: </span>
        <span class="spf_normal_input"><input type="text" id="email" name="email" size="30" /></span><br />
        </div>
        <div class="spf_input_pair">
        <span class="spf_block_prompt">Subject: </span>
        <span class="spf_normal_input"><input type="text" id="subject" name="subject" size="30" /></span><br />
        </div>
          
        <div class="spf_block_prompt">Please enter your comments below.  Click "Submit" when done.:</div>
        <div class="spf_textarea">
        <textarea name="comments" rows="10" cols="50"></textarea>
        </div>
        <div class="spf_buttons"><input type="submit" name="s" value="Submit" /> 
        </div>
        </form>
        </div>"/>
        	

        My template is simple, everything is in static chunk files except for the snippet call in the content area of the document.
        [[$site_header? &showParent=`true`]]
         <div class=grids><h1>[[*pagetitle]]</h1></div>
        [[*content]]
        [[$site_footer]]

        JavaScript area from site_header chunk:
        <title>[[*pagetitle]] 
             [[+showParent:notempty=`:: [[*parent:getPagetitle]] `]]
             :: [[++site_name]]</title>
        	 <script src="assets/templates/main/js/libs/jquery-1.7.1.min.js" type="text/javascript"></script>
                <script src="assets/templates/main/js/libs/jquery.validate.min.js" type="text/javascript"></script>

          Frogabog- MODX Websites in Portland Oregon
          "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
          Having server issues? These guys have MODX Hosting perfected - SkyToaster