We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47432
    • 48 Posts
    Hi,
    i'm learning modx, and i have problems with formit

    this is my code:
      [[!FormIt?
       &hooks=`email`
       &emailFrom=`[email protected]`
       &emailTpl=`myEmailChunk`
       &emailTo=`[email protected]`
       &emailSubject=`[[+subject]]`
       &validate=`name:required,
          email:email:required`
    ]]
    
    
              <div class="">
                <form id="email-form" name="email-form"   action="[[~[[*id]]]]" method="post">
                  <input class="w-input form-input" id="name" type="text" placeholder="Enter your name" name="name"  value ="[[!+fi.name]]">
                  <input class="w-input form-input" id="email" type="email" placeholder="Enter your email address" name="email"  required="required" value ="[[!+fi.email]]">
                  <input class="w-input form-input" id="field" type="text" placeholder="Enter your subject" name="field" required="required" value ="[[!+fi.subject]]">
                  <textarea class="w-input form-input textarea" id="field-2" placeholder="Enter your message" name="field-2" value ="[[!+fi.message]]"></textarea>
                  <input class="w-button submit-button" type="submit" value="Submit" data-wait="Please wait...">
                </form>


    and this is the message i received:

    Name: alexadark

    Email: [email protected]

    subject: [[+subject]]

    message: [[+message]]

    So it works for name and email, but not for subject and message, and i don't understand why

    for the moment i don't had the error and alert message

    thanks in advance for anyone helps me!
      • 37042
      • 384 Posts
        ...
        • 47432
        • 48 Posts
        Thank you, it works!
        i'm very bad with forms :-(
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Yeah, it took me a long time to finally figure out the logic behind forms. It's a good idea to practice several times on a development site, I found that sample form in the documentation very helpful for studying and experimenting with.

          What's really fun is to put the FormIt snippet and the form on a resource with no template and use that as the target of an AJAX request so that the form is displayed as a popup or slideout on clicking a trigger button, and no page refresh on posting. The tricky part is getting the popup to continue displaying after posting the form in the case of errors or to show the thank-you message (with a button for closing the popup).
          http://jqueryui.com/dialog/#modal-form
          [ed. note: sottwell last edited this post 12 years, 5 months ago.]
            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
            • 47432
            • 48 Posts
            Yes i'm learning, and really enjoying it! specially with this forum where i have answers to all my questions in less than an hour!
            I come from wordpress (working with frameworks like genesis and ultimatum), but lastly i have discovered webflow: https://webflow.com/, and it really allow to create beautiful things quickly and well coded, so i searched for a good cms easier to integrate than wp, and i'm so happy to found modx
            With webflow i think i can easily display form in slideout.
            this is a template i have built for webflow market (waiting for validation!): http://seen-theme.webflow.com/
            and i'm integrating it in modx: http://webstantly.com/seenmodx (i've tried on wp and the sliders, and interaction breaks)
            as you can see in the works section i show each work in a slideout, now i'm going to see how to integrate it with getresources i think, or do you see a better way ?

            Anyway thank you for your help! smiley
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I've seen a few of these one-page sites, and they can be really nice. Here's something that can add a bit of fun (check out the mini-page in the upper right) http://larsjung.de/fracs/
                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
                • 47432
                • 48 Posts
                thanks, i keep in my marks for when i have time to try it!
                i really like onepages, this is the actual trend, but as i said in another post they are not very good for seo (i collaborate with a seo guy who send me clients)
                perhaps the solution is having a onepage + a blog in a a separate page
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Hm. The slider in the "works" section doesn't work too well on my 13" screen. I usually have to do a bunch of scrolling to see the slider image, especially from the images in the lower rows. I liked the popover images in the "about us" section much better.
                    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
                    • 47432
                    • 48 Posts
                    Thanks for you advice!
                    i don't have a 13', i have 15, 24, iphone and tablet...
                    as i like to create templates and hope to have sales, try to find the more creative ways to please most of the people
                    btw, i was looking at the modx templates on themeforest, do you think it will be a growing market ? as i think modx users are more advanced than wordpress users (i begin in the web buying wp templates on themeforest, i only learn code after that) so are they in demand of templates ?
                    i like creating templates as it gives me more creative freedom than clients!
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      I think it's debatable as to whether or not MODX users are "more advanced" than Wordpress users. And I think there is a good market for good templates, especially those that are specialized or provide interesting plug-and-play features.
                        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