I've got a page that uses Ajax to submit the contents of a feedback
form without refreshing the page. It all works fine with IE7 and
Firefox on Windows but not with at least one user's Firefox on Mac
platform. The web server is IIS6.

The code I'm using is contained in a script file referenced in the
<head> tag and looks like this:

$(function() {
    //trigger ajax on submit
    $('#feedbackform').submit( function(){

        //hide the form
        $('#feedbackform').hide();

        //show the loading bar
        $('.loader').append($('.bar'));
        $('.bar').css({display:'block'});

        //send the ajax request
        $.ajax({
            type: "POST",
            url: "default.aspx",
            data: {pageaction:$('#pageaction').val(),thispageaction:$
('#thispageaction').val(),comment:$('#comment').val()},
            dataType: "text",
            success: function(text){
                $('.bar').css({display:'none'});
                $('.loader').append(text);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown)
{
                alert('There was an error saving your feedback.');
            }
        });

        //stay on the page
        return false;
    });
});

And the form:

<form id="feedbackform" name="frmMain" action="default.aspx"
method="post">
        <input type="hidden" name="pageaction" id="pageaction"
value="feedback" />
        <input type="hidden" name="thispageaction" id="thispageaction"
value="{//pageaction}" />

        <fieldset>
                <legend>Feedback</legend>

                <p>
                        If you'd like to see something changed, or have any 
feedback about
this page, please fill in
                        the comments box below and click Submit to let us know.
                </p>

                <textarea name="comment" id="comment" rows="4" 
cols="35">&#160;</
textarea>

                <br />
                <input type="submit" name="submitbutton" id="submitbutton"
value="Submit" />
        </fieldset>

</form>

Unfortunately I don't have access to a Mac and this problem has been
reported by a user who we're not keen to bug too much. Basically when
he clicks the submit button on the form, nothing happens and we get no
record in the web server logs of the request coming in, so I'm
assuming that the above ajax call is not working on his platform.

Are there any issues with the above code that anyone can spot which
might cause this problem? I'm hoping I've made a basic error
somewhere. Any help appreciated.

Reply via email to