Unrecognized function - but why?

Posted by fmz on Stack Overflow See other posts from Stack Overflow or by fmz
Published on 2010-03-23T13:01:10Z Indexed on 2010/03/23 13:03 UTC
Read the original article Hit count: 309

Filed under:
|

I have an Ajax contact form that links to a jquery file but for some reason I get the following error in Firebug:

$("#contactform").submit is not a function

Here is the link to the jquery file:

<script type="text/javascript" src="scripts/jquery.jigowatt.js"></script>

Here is the jquery code:

jQuery(document).ready(function(){

$('#contactform').submit(function(){

    var action = $(this).attr('action');

    $("#message").slideUp(750,function() {
    $('#message').hide();

    $('#submit')
        .after('<img src="assets/ajax-loader.gif" class="loader" />')
        .attr('disabled','disabled');

    $.post(action, { 
        name: $('#name').val(),
        company: $('#company').val(),
        email: $('#email').val(),
        phone: $('#phone').val(),
        subject: $('#purpose').val(),
        comments: $('#comments').val(),
        verify: $('#verify').val()
    },
        function(data){
            document.getElementById('message').innerHTML = data;
            $('#message').slideDown('slow');
            $('#contactform img.loader').fadeOut('slow',function() {$(this).remove()});
            $('#contactform #submit').attr('disabled',''); 
            if(data.match('success') != null) $('#contactform').slideUp('slow');

        }
    );

    });

    return false; 

});

});

And last but not least, here is the page where it is all supposed to come together: http://theideapeople.com.previewdns.com/contact_us.html

I would appreciate some help getting the function to function properly. Thanks.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ajax