We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35764
    • 35 Posts
    I’ve built a contact form using eform and all working perfectly. I have one question, is it possible to set some of the form fields so they are not required?

    thanks

    Lisa
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Yes, just have a 0 in the "required" field of the eform attribute.
      <input type="text" name="url" id="cf_url" class="text" eform="Your URL::0" />
        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
        • 35764
        • 35 Posts
        thank you for your reply, sorry I’m new to this - can you confirm where I need to put this? My form code is

        <form method="post" action="[~[*id*]~]"><input type="hidden" name="formid" value="feedbackForm" />
        <label for="subject">Subject</label>
        <input maxlength="60" name="subject" type="text" /></br>
        
        <label for="message">Message</label>
        <textarea cols="40" rows="10" name="message"></textarea></br>
        
        <label for="firstname">First Name:</label>
        <input maxlength="60" name="name" type="text" />
        <label for="lastname">Last Name:</label>
        <input maxlength="60" name="lastname" type="text" /></br>
        
        <label for="company">Company:</label>
        <input maxlength="60" name="company" type="text" required="yes" /></br>
        
        Please enter the anti spam code below (Please note this is case-sensitive):</br>
        
        <img src="[+verimageurl+]" border="1" alt="verification code" />
        
        <label for="vericode">code</label>
        <input name="vericode" size="20" type="text" /></br>
        
        <input name="submit" type="submit" value="Send Feedback" />
        
        </form>
        


        At the moment all the field are not required it seems so i’m a bit confused (new to eform)

        thanks

        Lisa