Script working in FF but not IE (surprise surpise)

Discussion in 'jQuery' started by danramosd, Jan 5, 2011.

  1. #1
    I have code that works fine in FF but not in IE. Certain values are hidden in the second drop down depending on the value of the first drop down selected. The values are hidden correctly in FF, but everything is displayed in IE:
    function updateMountingMethod()
    {
    	//Gets the selected value of the "Choose Awning Width"
    	var selectedVal = $('#attrib-13 option:selected').text().split(" ")[0];
    		//loops through the select list of the Mounting drop down
    		$.each($("#attrib-7").children(), function(){
    		//Gets the text (text shown to the user)
    		var optionText = $(this).text();
    		//Gets the value of each select option
    		var values = optionText.split('|')[1];
    		//Checks if its undefined which is true for the Please Select option
    		if(values != undefined){
    			//Gets just the first 2 digits so we dont have to worry about ' and '' and inches
    			
    			if(values.substring(1,3) != selectedVal)
    			{
    				//If it doesnt match the awning width it is not shown to the user
    				$(this).css('display','none');
    				alert($(this).css('display'));
    			}
    			else
    			{
    				//Gets rid of the extra | | 
    				$(this).text($(this).text().split("|")[0]+$(this).text().split("|")[2]);
    			}
    		}
    	})
    
    
    		}
    Code (markup):

    If this isnt completely clear here is a better description.
    I have a jQuery code that is called every time a drop down value is changed. When the value is changed it gets the size of the selected element. The values displayed look like 11 ft, 15 ft, 19 ft, so i split it to just get the number and not the ft. Depending on the value selected it needs to update the next drop down menu which follows this format:
    Item 1 | 11'11" |
    Item 2 | 15'9" |
    Item 3 | 19'9" |
    ...

    I don't want the stuff between the | | to show, it is just there to match up each item with the selected length (i.e 11 ft option in the first drop down is selected, then only the 11'11" option is displayed in the second drop down). Can anyone tell me why these extra values are not being hidden in IE?
     
    danramosd, Jan 5, 2011 IP
  2. CSM

    CSM Active Member

    Messages:
    1,047
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    55
    #2
    Possible to see this code in an online example? Would help much more.

    Did you check the IE WebDev Tools? Any error messages in IE?

    If so please post the error message, thanks.
     
    CSM, Jan 5, 2011 IP
  3. danramosd

    danramosd Active Member

    Messages:
    115
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    83
    #3
    danramosd, Jan 5, 2011 IP
  4. daljit

    daljit Well-Known Member

    Messages:
    312
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #4
    Can you show me the url of the site...
     
    daljit, Jan 6, 2011 IP