We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10746
    • 126 Posts
    My Contact Me page looks terrible...

    I am using the "built-in" ContactForm snippet ... my first problem was that it uses a tag called [(sitename)] which seems to be incorrect - it should be [(site_name)] I think.

    The second problem is that the fields are not displayed above each other

    Your name: <---- textbox ----->
    Your email: <---- textbox----->
    Regarding: <--- dropdown ---->

    but just wrapped around any old how..

    Your name: <---- textbox -----> Your email:
    <---- textbox-----> Regarding: <--- dropdown ---->


    Should I be using ContactForm at all or is it deprecated/replaced?

    Or do I edit it and put
    after every label?

    Or add CSS somewhere?


    Finally, can I add a captcha to the contact form (easily)?

    Thanks

    Gordon
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You use CSS to control its appearance. A good start is
      #whatever-the-container-is label{
      display:block;
      }
      

      I just updated mine on http://www.sottwell.com; here’s the css I used for it:
      #cfSet {
      width:70%;
      padding:20px;
      border:2px solid #559900;
      }
      #cfSet label {
      display:block;
      margin-bottom:10px;
      }
      
      #cfSet input{
      width:60%;
      margin-left:20px;
      }
      
      #cfSet textarea{
      width:80%;
      margin-left:10%;
      margin-top:5px;
      }
      
      #cfSet input.button{
      margin-left:10%;
      background:#dce7c5;
      }
      

      I’m using the MODxCSS template, so this kind of makes it match.
        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
        • 25663 MODX Staff
        • 12,272 Posts
        I would highly recommend upgrading your forms to use eForm... they’re significantly better and do a better job of hiding email addresses from email harvesting bots. In fact, all forms in 095 have been converted to eForm and ContactForm is deprecated.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 10746
          • 126 Posts
          Quote from: rthrash at Nov 08, 2006, 08:54 AM

          I would highly recommend upgrading your forms to use eForm... they’re significantly better and do a better job of hiding email addresses from email harvesting bots. In fact, all forms in 095 have been converted to eForm and ContactForm is deprecated.

          Sounds good to me... in fact I think that my version of ContactForm is completely junked... I must have accidentally deleted half of it at some stage because it has no SELECT element for the Subject: part of the mail. I tried to locate it on the repository but it was not there.. I guess maybe the built-ins don’t appear there?

          Sottwell, thanks for the CSS.. I have been fiddling with your port of andreas01 and gradually figuring it all out.

          My other question remains: can a captcha be added to an eForm easily?

          Thanks

          Gordon
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            &vericode=`1`

            I’ve got a tutorial on making a simple contact form using 1.3, while 1.4.1 has a lot more to offer, the tutorial is still valid.
              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
              • 10746
              • 126 Posts
              Quote from: sottwell at Nov 08, 2006, 11:05 PM

              &vericode=`1`

              Indeed... it would help if I read the whole list of features before posting..

              Anyway, I downloaded and installed eForm and had the following (mostly resolved) issues:

              (1) For some reason, all of the wretched files that I download from MODx seem to not have a terminating "\n" on the end of the file - the effect is that when I cut-n-paste (on Linux) I have to do something special to get the very LAST line of the file. Seeing snippets usually have "return $output;" as their last line, omitting it causes me mysterious problems... I can get rid of the Windows "carriage-return / new-line" business using "dos2unix" but the lack of ANY terminating characters at the end of the file catches me out every time sad

              (2) The existing documentation (ie the file eform_examples.htm) makes cunning changes in the CASE of various words to confuse the new user... for example, the sample chosen chunk names are "eFeedBackForm" (capital B) and "eFeedbackReport" (lowercase B). But the best of all is the "eFeed[Bb]ackThanks" where the suggested name is capital B, and the actually USED name (in the sample snippet call) uses lower-case B.

              (3) When I finally got those sorted out, the form appears, but on testing it, I end up with the message "Your name: expected at least two words" - even when I put in two, three or even FOUR words as my test name. I saw in the long long "eForm support" thread that I can remove the test altogether by deleting the REGEX expression part, so I have done that for the time being...

              But suppose I want to KEEP the test, but I want it to work? I’m not sure of the mechanism underlying the #REGEX expression [i.e. not the regular expression part, but how that syntax causes the regular expression to be checked/matched/evaluated]

              One more question .. if you can explain easily, how does the eForm "know" whether it should be displaying the "Thanks" message or the "Form" given that they appear on the same page id...

              Thanks ..

              Gordon

                • 28042 ☆ A M B ☆
                • 24,524 Posts
                The last one I can answer, it sees the POST value, and if all the POST submissions pass their respective validation tests, then it does the "thank-you" thing.
                  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