treehouse : what would you like to learn today?
Web Design Web Development iOS Development

IE7 Form problem

  • Hey all,
    I am using a form that validates and sends without a refresh via jquery and an error is being thrown when testing in IE7 :
    Webpage error details
    Message: Expected identifier, string or number
    Line: 17
    Char: 3
    Code: 0
    URI: http://www.snipped.com/jigowattprocess.js


    Here is the FORM itself:
    <div id=\"form\">
    <form action=\"contactprocess.php\" method=\"post\" id=\"info\">

    <div id=\"message-wrap\" class=\"slider\">
    <label for=\"Message\">Message</label>
    <textarea cols=\"32\" rows=\"10\" id=\"message\" name=\"message\"></textarea>
    </div><!--end comment-wrap-->

    <div id=\"name-wrap\" class=\"slider\">
    <label for=\"name\">Name</label>
    <input type=\"text\" id=\"name\" name=\"name\">
    </div><!--end name-wrap-->

    <div id=\"email-wrap\" class=\"slider\">
    <label for=\"email\">E&ndash;mail</label>
    <input type=\"text\" id=\"email\" name=\"email\">
    </div><!--end email-wrap-->

    <div id=\"antispam-wrap\" class=\"antispam\">
    <label for=\"url\"></label>
    <input type=\"url\" id=\"antispam\" name=\"antispam\" />
    </div><!--end antispam-wrap-->
    <input type=\"submit\" id=\"btn\" name=\"btn\" value=\"submit\">
    </form>

    </div><!--end form-->


    And finally here is the Jquery:
    jQuery(document).ready(function(){

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

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

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

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

    $.post(action, {
    name: $('#name').val(),
    email: $('#email').val(),
    message: $('#message').val(),

    },
    function(data){
    document.getElementById('form').innerHTML = data;
    $('#form').slideDown('slow');
    $('#info img.loader').fadeOut('fast',function(){$(this).remove()});
    $('#info #submit').attr('disabled','');
    if(data.match('success') != null) $('#info').slideUp('slow');

    }
    );

    });

    return false;

    });

    });


    I did not post the PHP form processor since this is the javascript forum, but if it will help, please let me know and I will post as well.
    Thanks in advance!
  • well source doesnot seems to be formatted. if you can use tool like pastebin.com and paste your source there then i can find some conclusion. but at me issue could be when you are dealing with javascript in ie. "," is major problem other then there will be things like unexpected type and others but the main issue could be separator like ",".
  • Bear with me on the ugly code problem. That is an artifact of conversion from the old forums. I hope to be able to clean up all those old posts. New posts should be fine, just stick all code in pre and code tags, unescaped.
  • If I could edit his post and fix it I would, but @Preeminent will have to do that.