View Single Post
Old 08-18-2012, 02:30 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,172
Thanks: 59
Thanked 3,993 Times in 3,962 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Same way it is done for the other <select>s.

Look at them:
Code:
var inunittext = inunit.options[inunit.selectedIndex].text;
var outunittext = outunit.options[outunit.selectedIndex].text;
var densunittext = densunit.options[densunit.selectedIndex].text;
So
Code:
var substance = document.getElementById("substance");
var substanceAsText = substance.options[substance.selectedIndex].text;
I used substanceAsText because you already have a variable named substanceText used for another purpose.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote