We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40088
    • 708 Posts
    I have 3 forms on the same page. The only problem I've found (so far) has to with one form's validation errors triggering the other 2 forms error handling. The easiest way to explain it is with a screenshot, https://www.dropbox.com/s/i5vudmceusv634f/FormIt.tiff.

    The “Appointments” form is showing the correct errors, but as you can see the other 2 forms should not be throwing any alerts.

    Below is the code used to display errors for the Appointments form only. Obviously the other 2 form have their own. I tried giving the [[!+fi.error_message]] a unique name (for each form) but that didn't quite work.

    [[!+fi.error_message:notempty=`<p class="error">[[!+fi.error_message]]</p>`]]
    [[!+fi.validation_error_message:!empty=`<div>
    <h3>Please fix the following errors:</h3>
    <ul>
    	[[!+fi.error.nameAppt:!empty=`<li class="trigger"><a href="[[~[[*id]]]]#nameAppt"><span><strong>Name</strong></span> is a required field.</a></li>`]]
    	[[!+fi.error.emailAppt:!empty=`<li class="trigger"><a href="[[~[[*id]]]]#emailAppt"><span><strong>Email</strong></span> is a required field.</a></li>`]]
            [[!+fi.error.textAppt:!empty=`<li class="trigger"><a href="[[~[[*id]]]]#textAppt"><span><strong>Message</strong></span> is a required field.</a></li>`]]
    </ul>
    </div>`]]
    
    <div id="feedback">
    	<p>[[+fi.successMessage]]</p>
    	<div class="errors">
    		[[+fi.error.error_messageAppt]]
    	</div>
    </div>

    This question has been answered by sottwell. See the first response.

      Todd
    • discuss.answer
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You should be able to specify a different placeholder prefix for each form.
      &placeholderPrefix - The prefix to use for all placeholders set by FormIt for fields.
        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