DavidInLove
asked on
javascript get selected index from select using IE9
Hi,
This javascript code was OK with previous version of IE and still is with
Fire Fox but unfortunately not with IE9
Could some one help myself, Please?????
var cost = (indexsite .options[listecost.selecte dIndex].va lue);
It is about a HTML select to get the selected index:
var indexsite = document.getElementById('c ollabro');
var val = (indexsite .options[collabro.selected Index].val ue).split( "#");
matricule=val[2].replace(" (","");
matricule_RO=matricule.rep lace(")"," ");
nom_RO = val[0]+' '+val[1];
indexsite = document.getElementById('l istecost') ;
var cost = (indexsite .options[listecost.selecte dIndex].va lue);
Thanks a lot??????????????
This javascript code was OK with previous version of IE and still is with
Fire Fox but unfortunately not with IE9
Could some one help myself, Please?????
var cost = (indexsite .options[listecost.selecte
It is about a HTML select to get the selected index:
var indexsite = document.getElementById('c
var val = (indexsite .options[collabro.selected
matricule=val[2].replace("
matricule_RO=matricule.rep
nom_RO = val[0]+' '+val[1];
indexsite = document.getElementById('l
var cost = (indexsite .options[listecost.selecte
Thanks a lot??????????????
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Let me check ill get back 2u
ASKER
OK Thanks a lot
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have tried this already but unfortunately it was not succed
var cost = indexsite.options[indexsit e.selected Index].tex t
var cost = indexsite.options[indexsit
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try separating the .split() command, just a hunch.
ASKER
This I've found in
http://www.w3schools.com/jsref/prop_select_selectedindex.asp
function displayResult()
{
var x=document.getElementById( "mySelect" ).selected Index;
var y=document.getElementById( "mySelect" ).options;
alert("Index: " + y[x].index + " is " + y[x].text);
}
</script>
</head>
<body>
<form>
Select your favorite fruit:
<select id="mySelect">
<option>Apple</option>
<option>Orange</option>
<option>Pineapple</option>
<option>Banana</option>
</select>
</form>
http://www.w3schools.com/jsref/prop_select_selectedindex.asp
function displayResult()
{
var x=document.getElementById(
var y=document.getElementById(
alert("Index: " + y[x].index + " is " + y[x].text);
}
</script>
</head>
<body>
<form>
Select your favorite fruit:
<select id="mySelect">
<option>Apple</option>
<option>Orange</option>
<option>Pineapple</option>
<option>Banana</option>
</select>
</form>
ASKER
It seems this code is OK just for FireFox not for IE