Graffiti.js - Contact.submitMessage - wrong field referenced

Last post 09-04-2008 6:48 AM by hesed4him. 5 replies.
Page 1 of 1 (6 items)
  • Graffiti.js - Contact.submitMessage - wrong field referenced

    01-30-2008 7:17 PM

    Line 249 of __utility\js\graffiti.js says:

    $('comment').value = '';

    The default comment.view in __utility\forms has a 'message' field, not 'comment'.

    I ended up modifying my copy of the method to clear all fields on a successful send:
    $('subject').value = '';
    $('name').value = '';
    $('email').value = '';
    $('message').value = '';

    I'm still trying to figure out how to clear the fields on a successful send, but NOT when there's an error such as 'All of the fields are required, your message has not been sent'.

  • Re: Graffiti.js - Contact.submitMessage - wrong field referenced

    01-30-2008 7:43 PM

    It feels dirty, but to clear the fields on a successful send, I did this:

    if(response == "Your message was received. Thanks!") {
        $('subject').value = '';
        $('name').value = '';
        $('email').value = '';
        $('message').value = '';
    }

  • Re: Graffiti.js - Contact.submitMessage - wrong field referenced

    01-31-2008 10:03 AM

    Thanks for the bug info. It has been fixed.

    We are not yet completely happy with how you build and manage forms in Graffiti which is why there are not many of them and information around them is lacking. It is one of those areas where we are just waiting on a better idea and then we will jump on it. :)

    Thanks,
    Scott

  • Re: Graffiti.js - Contact.submitMessage - wrong field referenced

    09-03-2008 1:50 PM

    Scott, I like how you guys have the system setup.

    Why not have a function in the core where we specify the contact view and the email view?  We then would place each view in its corresponding directory.

    So currently you guys have $macros.ContactForm()

    How about an overloaded function: $macros.ContactForm("myForm.view","myEmail.view")

    This would make it easier for you guys to quickly implement.

    Thanks,
    Joshua

  • Re: Graffiti.js - Contact.submitMessage - wrong field referenced

    09-04-2008 6:17 AM

    With the existing $macros.LoadView method this really isn't necessary. LoadView will load a view file from your current theme and should fit (IMO) most of the use cases.

    Thanks,
    Scott

  • Re: Graffiti.js - Contact.submitMessage - wrong field referenced

    09-04-2008 6:48 AM

    Scott,

    See post: http://support.graffiticms.com/t/1037.aspx

    How would I accomplish this?

    Thanks,
    Joshua

Page 1 of 1 (6 items)