Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Peter Alcock 113 posts 176 karma points
    Apr 23, 2016 @ 01:25
    Peter Alcock
    0

    Umbraco 7 & PliableForms

    Hey all,

    I have installed pliableforms in my umbraco 7 installation but having a bit of trouble. Have created the form, added macro etc which is all fine and the form appears on my page.

    However when i submit the form it shows the loading image but goes no further and sends no mail. i am getting the following error when i inspect element

    **Uncaught TypeError: $form.find(...).placeholder is not a function**
    PliableForm @ PliableForm.js:256
    (anonymous function) @ PliableForm.js:3
    b.extend.ready @ jquery.min.js:29
    u @ jquery.min.js:37
    
    **Uncaught TypeError: jQuery.toJSON is not a function**
    submitForm @ PliableForm.js:85
    (anonymous function) @ PliableForm.js:237
    m.event.dispatch @ jquery.min.js:3
    r.handle @ jquery.min.js:3
    

    I only have the two required JS files being called (have read about interferance?)

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>  
    <script type="text/javascript" src="/scripts/PliableForm.js"></script>
    

    Does anyone have any ideas? i have not modified the plaiableforms scripts, xslt or anything and calling the form from a macro as per normal. Used to use pliableforms a lot a few years back and never had any problems?

    Thanks

  • Peter Alcock 113 posts 176 karma points
    Apr 23, 2016 @ 02:30
    Peter Alcock
    0

    Nevermind people! Gave up and managed to sort a form straight from the partial view macro file, here it is if anyone else gets any trouble.

    @using System;
    @using System.Linq;
    @using System.Net.Mail;
    @{
    if (IsPost) { 
        string name = Request["Name"]; 
        string email = Request["Email"];
        string telephone = Request["Telephone"];
        try
                {
                MailMessage mail = new MailMessage();
                //var from = new MailAddress(Email.Text);
                mail.From = new MailAddress(email);
                mail.To.Add("[email protected]");
                mail.Subject = "Contact Us";
                mail.IsBodyHtml = false;
                mail.Body = "You just got a contact email:\n" +
                            "Name: " + name + "\n"
                            + "Phone: " + telephone + "\n"
                            + "Email: " + email + "\n";
    
                SmtpClient smtp = new SmtpClient();
    
                    smtp.Send(mail);
    
                }
                catch(Exception ex)
                {
    
                }     
        <text> 
          Success! <br /> 
    Thank you for your enquiry, you will be contacted by the holiday provider shortly.<br /> <br /> 
        </text> 
        }
    } 
    
    <div class="inputForm">
    <form method="post" action=""> 
    <fieldset> 
    <h2></h2>
    <div> 
    <label for="Name">Name</label> 
    <input type="text" id="Name" name="Name" value="" /> 
    </div> 
    <div> 
    <label for="Email">Email:</label> 
    <input type="text" id="Email" name="Email" value="" /> 
    </div> 
    <label for="Telehphone">Telehphone:</label> 
    <input type="text" id="Telephone" name="Telephone" value="" /> 
    </div> 
    <div> 
    <label>&nbsp;</label> 
    <input type="submit" value="Submit" class="submit" /> 
    </div> 
    </fieldset> 
    </form> 
    
  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Apr 23, 2016 @ 02:40
    Nicholas Westby
    100

    You might want to consider Formulate (disclaimer: I built Formulate): http://www.formulate.rocks/

    It only works on the latest versions of Umbraco, however, so keep that in mind.

    Regarding your Pliable error, perhaps you need to include something like this jQuery Placeholder JavaScript: https://github.com/mathiasbynens/jquery-placeholder

    Regarding your other JavaScript error, perhaps you need to include this on your page: https://github.com/krinkle/jquery-json

    And also make sure you have SMTP configured in your web.config.

    By the way, it seems Pliable has a couple forums at the bottom of this page (you may have more luck there getting an answer): https://our.umbraco.org/projects/website-utilities/pliable-ajax-contact-form/

  • Peter Alcock 113 posts 176 karma points
    Apr 23, 2016 @ 03:01
    Peter Alcock
    0

    Thanks Nicholas ill have a look at the Formulate if it's a better way of doing things, would have like AJAX rather than POST so no page reload.

    You can probably guess i'm no hardcore developer/programmer but i tend to be able to piece things together with some determination!

    Thanks

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Apr 23, 2016 @ 03:55
    Nicholas Westby
    0

    Cool, if you decide to give Formulate a try, here's the TLDR version:

Please Sign in or register to post replies

Write your reply to:

Draft