Bharanikumar
Bharanikumar

Reputation: 25733

jquery problem in IE working fine in FF

   function populate_customer_details(){
        $.ajax({
            type : 'POST',
            url : 'populate_customer_details.php',
            data: {
                email : $('#txt_email_id').val()
            },
            success : function(data){
                if(data=="NOROWSFOUND"){
                    alert("Sorry, Email ID not exist in our database"); 
                    document.getElementById("txt_email_id").focus();    

                }else{
                    var val = explode_all_into_arr(data,"|=|");
                    document.getElementById("FirstName").value = val[0];
                    document.getElementById("LastName").value = val[1];
                    document.getElementById("mobilecountrycode").value = parseInt(val[2]);
                    document.getElementById("MobileNo").value = val[3];
                    document.getElementById("homecountrycode").value = parseInt(val[4]);
                    document.getElementById("HomeNo").value = val[5];
                    document.getElementById("PaxEmail").value = val[6];
                    document.getElementById("PaxEmailConf").value = val[6];
                }
            },
        });
}

This is my snippet purpose is getting the customer details and populate into textfield and combo box ,

That is

Firstname will append into Firstname text field ,

Secondname will append into Secondname text field ,

Same like mobilecountrycode (but this is dropdown combo),

Some time combo selectedindex work fine, but some time not selecting the value ,

I am not sure what s problem in that...

Nothing works in IE ,

Also showing object expected error in IE ,

i have ajax_common.js : in this i added above script ,

in the page top first i included the jquery.js , Then i include ajax_common.js file,

But no idea why this problem.

Regards

(NOTE i included the jquery.js )

,

Upvotes: 0

Views: 92

Answers (1)

b0x0rz
b0x0rz

Reputation: 3981

maybe this is the problem? http://remysharp.com/2007/02/10/ie-7-breaks-getelementbyid/

IE is treating the name attribute on forms as the ID attribute, causing the getElementById to return very unexpected results.

Upvotes: 1

Related Questions