We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27023
    • 36 Posts
    Ok i’m using FormIt 1.5.2 on Modx Revolution 2.0.4 and having this problem:

    Basically i don;t require an email address in the form but if it does have one i need it to validate as a correctly formatted email. So if i just place
    &validate=`name:required,
                     email:email`
    

    in the validate parameter it does pick up on format however if left blank it also errors saying "invalid email address". I thought this would only do this is my value was
    email:email:required


    How can i get it to validate on format but not required???

    Also i have the redirect setup correctly and if an email address is entered it redirects fine, however if left empty it just refreshes the page. However on both occasions this still submits the form to the email address of the webmaster?

    Full code:
    [[!FormIt?
       &hooks=`spam,email,redirect,FormItAutoResponder`
       &fiarFrom=`[email protected]`
       &fiarTpl=`fiarTpl`
       &emailTpl=`Form`
       &emailTo=`[email protected]`
       &emailSubject=`Form`
       &store=`1`
       &redirectTo=`17`
       &validate=`name:required,
                  tel:required:maxLength=`13`:minLength=`10`,  
                  preferdate:required,
                  email:email`    
    ]]
      • 28215
      • 4,149 Posts
      Can you file that as a bug here:
      http://github.com/splittingred/FormIt/issues
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 27023
        • 36 Posts
        Done thanks!!