I have an error showing up in IE 10 and in Chrome:

The chrome version:

Uncaught TypeError: Object function ( selector, context ) {
        // The jQuery object is actually just the init constructor 'enhanced'
        return new jQuery.fn.init( selector, context, rootjQuery );
    } has no method 'format'

Unfortunately, I'm not sure what to do to fix the problem, using this script below? (and jquery 1.8.3 - I can't use a newer version right now, it kills other functions on the page for some reason.

$(function() {
    // Validate the contact form
  $('#contactform').validate({
    // Specify what the errors should look like
    // when they are dynamically added to the form
    errorElement: "label",
    wrapper: "div",
    errorPlacement: function(error, element) {
        error.insertBefore( element.parent().parent() );
        error.wrap("<div style='height:0px;overflow:visible;width:200px;margin-right:-200px;z-index:99999300;'></div>");
        $("<div style='height:0px;overflow:visible;width:200px;margin-right:-200px;margin-left:0px;z-index:99999300;'></div>").insertBefore(error);
    },

    // Add requirements to each of the fields
    rules: {
        name: {
            required: true,
            minlength: 2
        },
        last_name: {
            required: true,
            minlength: 2
        },
        postal_code: {
            required: true,
            minlength: 6
        },
        email: {
            required: true,
            email: true
        },
        telephone: {
            required: true,
            minlength: 10
        }
    },

    // Specify what error messages to display
    // when the user does something horrid
    messages: {
        name: {
            required: "Please enter your name.",
            minlength: jQuery.format("At least {0} characters required.")
        },
        last_name: {
            required: "Please enter your last name.",
            minlength: jQuery.format("At least {0} characters required.")
        },
        postal_code: {
            required: "Please enter a postal code.",
            minlength: jQuery.format("At least {0} characters required.")
        },
        email: {
            required: "Please enter your email.",
            email: "Please enter a valid email."
        },
        telephone: {
            required: "Please enter a phone number.",
            minlength: jQuery.format("At least {0} characters required.")
        }
    },

    // Use Ajax to send everything to processForm.php
    submitHandler: function(form) {
        $("#send").attr("value", "Sending...");
        $(form).ajaxSubmit({
            success: function(responseText, statusText, xhr, $form) {
                $(form).slideUp("fast");
                $("#response").html(responseText).hide().slideDown("fast");
            }
        });
        return false;
    }
  });
});

Recommended Answers

All 6 Replies

I just used a workaround on that other issue, that ignored the hash on IE. A bit of a cheat, but it solved the problem. unfortunately that means I wouldn't know if it has anything to do with this issue.

this is a different script, so I didn't think it was related.

Member Avatar for LastMitch

Only problem being, I didn't solve the problem, and I wouldn't know if it has anything to do with this issue.

Workaround only works well if it's an isolate issue that's why it's call a workaround kinda like a cheat sheet like what you said which is correct.

I mean the more workaround for this issue you are having the harder the issue to resolve.

this is a different script, so I didn't think it was related.

Then you need another workaround.

The reason I mention the last thread because you haven't figure IE yet if you did you wouldn't post a issue with IE again.

If it was just Chrome I would go to a look at a different angle and I would post a link on a work around for it. But IE hasn't resolve yet.

That's not good at all. The more work you are doing and the more bug appears on IE and interfering the function (your code), it's like a pattern now. I feel you are heading in that direction.

I did find that in this situation, that there was a plugin that I needed to include in the index.php file for the script above to work, because I'm stuck on an older version of jquery.

I understand what you're saying above, I'm just dealing with somebody who wants things "done yesterday" so I was trying to solve a one-off issue as quickly as possible.

jQuery bugs are to be solved with jquery team

Is the problematic page publicly available to view?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.