My issue: This code works in firefox chrome and safari but not in IE 8. I had .change but i found out that it does not work in ie so i did .click and tried it again in all the browsers, all is working, try in ie still not working. The anythingSlider is a jquery library im using and i know for sure thats not the issue (going reverse works like selecting the item on the drop down and moving to that slide works everywhere including ie. Thanks.
My code:
$(document).ready(function() {
$('#skillslist').click(function()
{var str = $(this).attr('value');
var pattern = /[0-9]+/g;
var matches = str.match(pattern);
var myInteger = parseInt(matches);
$('#slider').anythingSlider(myInteger);
});
});
</script>
<select name='myList' id='skillslist'>
<option>Subscription Days Remaining: <? echo $days ?></option>
<option id='skill1'>Skill 1: Hand Washing</option>
<option id='skill2'>Skill 2: Abdominal Thrust on Conscious Resident</option>
<option id='skill3'>Skill 3: Ambulation using a Gait Belt</option>
</select>
I always try to avoid
$(this).attr('value')orthis.value, because select box values should be queried usingthis.options[this.selectedIndex]… which is what.val()does for you.Before you say “it does not work” describe what’s not working first and make sure to eliminate other factors by
alert()ing themyIntegervalue.