We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25898
    • 20 Posts
    Hi there


    How can i get the inputfields required?

    this is my code of the chunck

    [+validationmessage+]
    <form method="post" action="[~[*id*]~]">
    <input type="hidden" name="formid" value="feedbackForm" />
    <label for="name">Naam:</label>
    <input maxlength="60" name="name" size="40" type="text" />


    <label for="adres">Adres:</label>
    <input name="adres" size="40" type="text" />


    <label for="plaats">Plaats:</label>
    <input name="plaats" size="40" type="text" />


    <label for="telefoonnummer">Telefoonnummer:</label>
    <input name="telefoonnummer" size="40" type="text" />


    <label for="email">E-mailadres:</label>
    <input name="email" size="40" type="text" />


    <label for="bericht">Bericht:</label>


    <textarea cols="40" rows="10" name="bericht"></textarea>


    Please enter the anti spam code below:

    <img src="[+verimageurl+]" border="1" alt="verification code" />

    <label for="vericode">code</label>
    <input name="vericode" size="20" type="text" />


    <input name="submit" type="submit" value="Send Feedback" />
    </form>



    thnx
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Every field should have an extra attribute, eform="" (don’t worry about validation, eForm handles this internally and when the form goes to the browser this attribute is gone). Not only will this establish whether or not a field is required, it will trigger eForm to maintain the values of the fields with the attribute if the form is re-displayed on error.
      <input name="adres" size="40" type="text" eform="Adres::1" />

      The first field in the attribute is the text that will be used when showing an error message. The second one (left empty here) is for the type of data; for example an email field would have email there, so eForm knows to validate it for a proper email address. Usually it can be left empty; eForm is pretty good at determining how the form field’s data should be handled. The third field is 1 for requred, 0 for not required. There are other fields that can follow these three; see the eForm documentation for how to use them. I’ve never used any beyond these three.

      For multiple items, like a set of radio buttons, just put the eform attribute in the first one. For hidden input fields that have a variable value, use eform="::0::" to prevent eForm from thinking it’s a form hacking attempt.
        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
        • 25898
        • 20 Posts
        thank you!!!

        one more question, how can I edit the [+validationmessage+]

        and is it possible to get the validationmessage in a popup...?