Announcement

Collapse
No announcement yet.

Adding Form to CTUS Page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by slabar View Post

    We've replaced CASH with jQuery on dev.themartialartsstore.com and all appears to be working properly. We've added a Hero Slider [SFNT], made some adjustments on the product page, etc.
    I was thinking you were trying to implement the CTUS form but I'm not seeing it on your dev site.
    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

    Comment


      #17
      Hi Leslie,

      That second error is being generated by the PHP file which is probably not seeing the tokens in the form which were added for preventing spam purposes.
      Matt Zimmermann

      Miva Web Developer
      Alchemy Web Development
      https://www.alchemywebdev.com
      Site Development - Maintenance - Consultation

      Miva Certified Developer
      Miva Professional Developer

      https://www.dev4web.net | Twitter

      Comment


        #18
        Originally posted by Matt Zimmermann View Post
        Hi Leslie,

        That second error is being generated by the PHP file which is probably not seeing the tokens in the form which were added for preventing spam purposes.
        I understand the second error - I just don't understand why I still see the first message.
        Leslie Kirk
        Miva Certified Developer
        Miva Merchant Specialist since 1997
        Previously of Webs Your Way
        (aka Leslie Nord leslienord)

        Email me: [email protected]
        www.lesliekirk.com

        Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

        Comment


          #19
          Hi Leslie,

          You would have to check for any other JavaScript errors and make sure the IDs being used on the form correspond to the JavaScript you are using.
          Matt Zimmermann

          Miva Web Developer
          Alchemy Web Development
          https://www.alchemywebdev.com
          Site Development - Maintenance - Consultation

          Miva Certified Developer
          Miva Professional Developer

          https://www.dev4web.net | Twitter

          Comment


            #20
            Originally posted by Matt Zimmermann View Post
            Hi Leslie,

            You would have to check for any other JavaScript errors and make sure the IDs being used on the form correspond to the JavaScript you are using.
            Are there other javascript files that are needed for this form? I'm not getting any sort of javascript errors but I noticed that the Shadows scripts.js doesn't have any sort related to the contact form such as js-contact-form like the scripts.js from other ReadyThemes. I'm thinking this is part of the problem, yes?
            Leslie Kirk
            Miva Certified Developer
            Miva Merchant Specialist since 1997
            Previously of Webs Your Way
            (aka Leslie Nord leslienord)

            Email me: [email protected]
            www.lesliekirk.com

            Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

            Comment


              #21
              Hi Leslie,

              There are several AJAX calls in the functions for the old form in the scripts.js file as well as calls to an additional PHP file called token.php. Generally, IDs are not used in the new ReadyThemes so those would need to be added as needed by the JavaScript.
              Matt Zimmermann

              Miva Web Developer
              Alchemy Web Development
              https://www.alchemywebdev.com
              Site Development - Maintenance - Consultation

              Miva Certified Developer
              Miva Professional Developer

              https://www.dev4web.net | Twitter

              Comment


                #22
                So can I copy the jsCTUS function and add it to the script.js file?


                Code:
                jsCTUS: function () {
                        // ---- Additional Server Security To Help Against Spambots ---- //
                        $.ajax({
                            cache: true,
                            crossDomain: true,
                            dataType: 'script',
                            url: '//ajax.aspnetcdn.com/ajax/jquery.validate/1.13.0/jquery.validate.min.js'
                        }).done(function () {
                            var contactForm = $('#js-contact-form');
                            $('#js-noscript-warning').remove();
                            contactForm.show();
                            $.get('../forms/token.php', function (tkn) {
                                contactForm.append('<input type="hidden" name="mms" value="' + tkn + '" />');
                            });
                
                            // ---- Form Validation ---- //
                            contactForm.validate({
                                errorContainer: '#js-contact-form div.message',
                                errorLabelContainer: '#js-contact-form div.message small',
                                errorElement: 'p',
                                rules: {
                                    contactName: {required: true, minlength: 2},
                                    contactEmail: {required: true, email: true},
                                    contactComment: {required: true, minlength: 2}
                                },
                                messages: {
                                    contactName: {required: 'Your Name Is Required', minlength: jQuery.validator.format('Your Name must be a minimum of {0} characters!')},
                                    contactEmail: {required: 'Your Email Address Is Required', email: 'Your Email Address must be formatted like [email protected]'},
                                    contactComment: {required: 'Comments or Questions Are Required', minlength: jQuery.validator.format('Your Message must be a minimum of {0} characters!')}
                                },
                                highlight: function (element, errorClass) {
                                    $(element.form).find('label[for=' + element.id + ']').addClass(errorClass);
                                },
                                unhighlight: function (element, errorClass) {
                                    $(element.form).find('label[for=' + element.id + ']').removeClass(errorClass);
                                },
                                submitHandler: function (form) {
                                    if ($(this).data('formstatus') !== 'submitting') {
                                        var form = contactForm,
                                            formData = form.serialize(),
                                            formUrl = form.attr('action'),
                                            formMethod = form.attr('method')
                
                                        form.data('formstatus', 'submitting');
                                        $.ajax({
                                            url: formUrl,
                                            type: formMethod,
                                            data: formData,
                                            success: function(data, textStatus, jqXHR) {
                                                // Show reponse message
                                                if (data.search(/error/i) != -1) {
                                                    $('#js-contact-form div.message').fadeOut(200, function () {
                                                        $(this).removeClass('message-info').addClass('message-error').text(data).fadeIn(200);
                                                    });
                                                }
                                                else {
                                                    $('#js-contact-form div.message').removeClass('message-error').addClass('message-success').text(data).fadeIn(200);
                                                };
                                                form.data('formstatus', 'idle');
                                            },
                                            error: function (jqXHR, textStatus, errorThrown) {
                                                console.log(errorThrown);
                                                form.data('formstatus', 'idle');
                                            }
                                        });
                                    };
                                }
                            });
                        });
                    },
                Leslie Kirk
                Miva Certified Developer
                Miva Merchant Specialist since 1997
                Previously of Webs Your Way
                (aka Leslie Nord leslienord)

                Email me: [email protected]
                www.lesliekirk.com

                Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                Comment


                  #23
                  Hi Leslie,

                  As long as you have changed over to jQuery and updated the form code with the proper IDs, you should be able to drop it in.
                  Matt Zimmermann

                  Miva Web Developer
                  Alchemy Web Development
                  https://www.alchemywebdev.com
                  Site Development - Maintenance - Consultation

                  Miva Certified Developer
                  Miva Professional Developer

                  https://www.dev4web.net | Twitter

                  Comment


                    #24
                    Well...the second part is already in place because the code was copied from a site that used the script file. As for changing over to jQuery...

                    It looks like at this point in time there is no easy way to get a contact for in Shadows?
                    Leslie Kirk
                    Miva Certified Developer
                    Miva Merchant Specialist since 1997
                    Previously of Webs Your Way
                    (aka Leslie Nord leslienord)

                    Email me: [email protected]
                    www.lesliekirk.com

                    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                    Comment


                      #25
                      Really wish this theme defaulted to jQuery.

                      Comment


                        #26
                        RTHOMASDESIGN - Swapping out for jQuery is a relatively straight forward process https://www.miva.com/forums/forum/de...ash-for-jquery
                        Matt Zimmermann

                        Miva Web Developer
                        Alchemy Web Development
                        https://www.alchemywebdev.com
                        Site Development - Maintenance - Consultation

                        Miva Certified Developer
                        Miva Professional Developer

                        https://www.dev4web.net | Twitter

                        Comment


                          #27
                          Yup, already have done it. The sentiment still stands ;)

                          Comment


                            #28
                            Originally posted by Matt Zimmermann View Post
                            RTHOMASDESIGN - Swapping out for jQuery is a relatively straight forward process https://www.miva.com/forums/forum/de...ash-for-jquery
                            Yes, the steps are very straightforward, but didn't help me since the JQuery I need isn't included. I don't want to blow the darn thing up. "I just want it to work" - will be the cry of many store owners wanting to be able to do this on their own.
                            Leslie Kirk
                            Miva Certified Developer
                            Miva Merchant Specialist since 1997
                            Previously of Webs Your Way
                            (aka Leslie Nord leslienord)

                            Email me: [email protected]
                            www.lesliekirk.com

                            Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                            Comment


                              #29
                              Originally posted by lesliekirk View Post
                              I was thinking you were trying to implement the CTUS form but I'm not seeing it on your dev site.
                              I haven't tried yet Leslie. I will try to set aside time tomorrow to look at it and see if I can get her running.

                              Sincerely,

                              Stephen M. LaBar, Jr.
                              (770) 441-9447
                              The Martial Arts Store

                              Please Visit Our Site At:
                              http://www.themartialartsstore.com

                              Comment


                                #30
                                So if I understand this thread correctly Miva released new software but failed to provide a solution to a function normally needed on most website.I haven't seen any response from the Miva technical department providing a current solution to this necessary function except to change the software back to the old style and use an old solution. Does that about sum it up? A very interested by stander.
                                Thanks,
                                Chet Vincentz
                                [email protected]

                                www.electrodyne.cc Quality Motoring Accessories
                                www.racdyn-usa.com BMW, MINI & Porsche performance
                                www.artisticartifacts.com Creative art materials

                                Comment

                                Working...
                                X