Validation not working in formit

I copied paste a formit example from documention in order to test the validation. However no error message appears and the form is submitted even when the “name” field is empty…
Any help would be greatly appreciated. The formit version is the 4.2.7-pl


<h2>Contact Form</h2>


<form action="[[~[[*id]]]]" method="post" class="form">

    <label for="name">
        <span class="error">[[!]]</span>
    <input type="text" name="name" id="name" value="[[!]]" />
    <div class="form-buttons">
        <input type="submit" value="Send Contact Inquiry" />

I tested this with the same FormIt version (on MODX 2.8.4, PHP 7.4), but I can’t reproduce the problem.
The validation works as expected.

Is it possible to be a server issue or something outside modx? The form is submitted without any validation…

Ok found the solution… I had two forms in the same page. I removed it and it works as expected.

For multiple forms on the page, you can add the property &submitVar, so that FormIt checks, if the correct form was sent.

<form id="myform" action="[[~[[*id]]]]" method="post">    
   <input type="submit" name="mySubmit" value="Send"> 

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.