Results 1 to 5 of 5

Thread: FormMail and Wordpress

  1. #1
    Join Date
    Nov 2012
    Posts
    2

    Question FormMail and Wordpress

    Hi Russell,

    I'm an old acquaintance (nay, shall I say friend), Michelle aka Ibis3* the sister of Linda who helped design your old site way back when. If you recall, I had Formmail working on a bunch of sites (some our own, and some for clients) and life was very good. Recently, I've been working on a redesign of a couple of our own sites, redoing them using WP as a CMS and I'm having problems getting FormMail to work with the dynamic pages. (At first, I tried just creating static error and thank you pages and keeping my old template folder but that resulted in a right mess.) I looked into your WP plugin, but I really don't think my needs warrant having hosted contact forms (plus, we have one form for file submissions, and two different domains involved).

    What I'd really like to have is a set of instructions/guidelines specifically tailored for FM installation in WP so that the two play nicely together. Right now, the good url is coming up fine** with a successful submission, but it's the error handling that isn't so happy. What do I need to put into my form and fmbadhandler and formmail.php to make it all work? I've set up a WP Page that has the URL: www.mydomain.ca/error/



    *For some reason, I couldn't find my old Tectite login info, and had to create a new user account.
    **Well, sort of fine. It has a PHP session id in the URL that I would be just as pleased to do away with.

  2. #2
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: FormMail and Wordpress

    Hi,

    Good to hear from you again!

    If you're having problems with the formatting/styling of the form within WP, our Form Wizard and the accompanying stylesheet works well.

    Also, we're moving to Ajax-based form submissions, so this helps avoid problems with needing to redirect to an error handler. Errors are displayed on the page without refreshing it.

    The JavaScript that handles this is formval.js.

    It's probably possible to get this working with FMBadHandler and non-Ajax form submission, but there will be some tricky bits because CMS's like WP tend to get in the way.

    Here's what I recommend:
    1. Use the Form Designer in the Wizard to design the form. This ensures it has the right HTML structure and uses the formdesigneruser.css stylesheet.
    2. Install it on your WP page and check it looks right. Use the instructions in the README file to assist.
    3. You'll need to put the stylesheet code in the <head> of your WP page by using WP features to do this. You'll also need to link to formval.js JavaScript similarly.
    4. Add this hidden field to the form:
      <input type="hidden" name="fmmode" value="auto" />
    That's it. You won't need fmbadhandler.php, as errors will be displayed in the page when they occur.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Nov 2012
    Posts
    2

    Default Re: FormMail and Wordpress

    Quote Originally Posted by russellr View Post
    Hi,

    Good to hear from you again!

    If you're having problems with the formatting/styling of the form within WP, our Form Wizard and the accompanying stylesheet works well.

    Also, we're moving to Ajax-based form submissions, so this helps avoid problems with needing to redirect to an error handler. Errors are displayed on the page without refreshing it.

    The JavaScript that handles this is formval.js.

    It's probably possible to get this working with FMBadHandler and non-Ajax form submission, but there will be some tricky bits because CMS's like WP tend to get in the way.

    Here's what I recommend:
    1. Use the Form Designer in the Wizard to design the form. This ensures it has the right HTML structure and uses the formdesigneruser.css stylesheet.
    2. Install it on your WP page and check it looks right. Use the instructions in the README file to assist.
    3. You'll need to put the stylesheet code in the <head> of your WP page by using WP features to do this. You'll also need to link to formval.js JavaScript similarly.
    4. Add this hidden field to the form:
      <input type="hidden" name="fmmode" value="auto" />

    That's it. You won't need fmbadhandler.php, as errors will be displayed in the page when they occur.
    Since I already have my forms and they are integrated visually with my site's theme already, I'd rather not have to start from scratch. Is there a way to adapt what I already have to use the new error handling?

    Here's the pertinent part of my contact form:

    Code:
    <form style="vertical-align: top; background-color: #F8F8F8;" action="http://www.mydomain.ca/formmail.php" method="post" name="inquiryform">
    <input style="display: none;" type="hidden" name="this_form" value="http://www.mydomain.ca/about/contact-us/" />
    <input style="display: none;" type="hidden" name="bad_url" value="fmbadhandler.php" />
    <input style="display: none;" type="hidden" name="bad_template" value="error.php" />
    <input style="display: none;" type="hidden" name="required" value="realname:Name,email:Email,subject:Subject,inquiry:Inquiry" />
    <input style="display: none;" type="hidden" name="good_url" value="http://www.mydomain.ca/thankyou/" />
    <input style="display: none;" type="hidden" name="mail_options" value="PlainTemplate=inquiry.txt,TemplateMissing=n/a" />
    <input style="display: none;" type="hidden" name="recipients" value="blaMANGLEblablabla" />
    ......
    <p class="rvrscap"><input type="text" name="rvrscap1" value="blablabla" />
    <input type="text" name="rvrscap2" value="" />
    Last edited by Michelle N.; 13-Nov-2012 at 07:40 PM. Reason: correction

  4. #4
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: FormMail and Wordpress

    Hi,

    OK. In that case, utilize formval.js by adding this to the <head> of your form's page:
    <script type="text/javascript" src="http://cdn.tectite.com/formval-v7.js"></script>

    This should cause error on the form to appear in-line without submission.

    The errors should appear near the fields that have a problem.

    You can style the errors message using a CSS class of "TectiteFieldError".

    Once that's working, just remove fmbadhandler and bad_template from your form.





    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  5. #5
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: FormMail and Wordpress

    For future reference for anyone reading this thread....

    PM message from Michelle:
    I'm happy to say that your suggestion worked. I downloaded a plugin (http://wordpress.org/extend/plugins/...avascript-css/) that allowed me to link to the script and style the error message.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. formmail doesn't work with wordpress
    By Mie in forum Features Questions
    Replies: 2
    Last Post: 02-Oct-2012, 12:39 PM
  2. formmail doesn't work with wordpress
    By Mie in forum Community Support
    Replies: 0
    Last Post: 01-Oct-2012, 12:00 PM
  3. Can I use FormMail to create new WordPress posts.
    By steve_park1008 in forum Community Support
    Replies: 1
    Last Post: 26-Jan-2012, 08:42 PM
  4. WordPress Troubles
    By bamosherjr in forum FormMail Subscription Support
    Replies: 1
    Last Post: 23-Apr-2007, 09:00 PM
  5. TecTite FormMail with Wordpress
    By bamosherjr in forum Community Support
    Replies: 3
    Last Post: 20-Apr-2007, 08:40 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •