Anari Sengbe
Anari Sengbe

Reputation: 81

Getting Jquery To Work With IE8

After HOURS of searching the web for a fix to IE8 and jQuery form submittion, the most common solution seems to be declaring variables on your Jquery script to get it to work with IE8, this is my standard jquery script that I use for all my forms. How do I declare the variables on this? I've got as far as

var url = "login_signup_hwnd.php";

but I have no clue how to declare variables for the text fields, do I have to do "var" for each text field id?

<script type="text/javascript">
    $(document).ready(function(){
        $('#send').click(function() {

            $('#waiting').show(500);
            $('#lginForm').hide(0);
            $('#message').hide(0);

            $.ajax({
                type : 'POST',
                url : 'login_signup_hwnd.php',
                dataType : 'json',
                data: {
                    address2: $('#address2').val(),
                    address: $('#address').val(),
                    myemail: $('#myemail').val(),
                    zip: $('#zip').val(),
                    states: $('#states').val(),
                    city: $('#city').val(),
                    lname: $('#lname').val(),
                    fname: $('#fname').val(),
                    pswd: $('#pswd').val(),
                    pswd2: $('#pswd2').val(),
                    mname: $('#mname').val(),
                    agree: $('#agree').val(),
                    country: $('#country').val()
                },
                success : function(data){
                    $('#waiting').hide(500);
                    $('#message').removeClass().addClass(
                           (data.error === true) ? 'error' : 'success'
                    ).text(data.msg).show(500);
                    if (data.error === true)
                        $('#loginForm').show(500);
                    else
                        $('#send').hide(500); // Members Area

                },
                error : function(XMLHttpRequest, textStatus, errorThrown) {
                    $('#waiting').hide(500);
                    $('#message').removeClass().addClass('error')
                        .text('There was an error.').show(500);
                   $('#loginForm').show(500);
                }
            });

            return false;
        });
    });
</script>

Upvotes: 0

Views: 139

Answers (1)

Sergej Brazdeikis
Sergej Brazdeikis

Reputation: 1373

for the beginning

change

$('#lginForm').hide(0);

to

$('#loginForm').hide(0);

Upvotes: 2

Related Questions