I have a form with several questions whose answers are chosen from select object. Some work and some don't. Here's an example
This works:
This doesn't work:
Can anyone show me why the second one does not write the text to the screen like the first one does?
This works:
Code:
var y = document.getElementById('coverageDesired'); var z = y.options[y.selectedIndex].value; if(z=="Property ONLY"){ document.getElementById('cellOutput05').innerHTML="Property coverage only"; } else if(z=="Liability ONLY"){ document.getElementById('cellOutput05').innerHTML="Liability coverage only"; } else if(z=="Property and Liability"){ document.getElementById('cellOutput05').innerHTML="Both Property and Liability coverage"; }
Code:
var y = document.getElementById('bankruptcy'); var z = y.options[y.selectedIndex].value; if(z=="YES"){ status="REFERRED"; document.getElementById('cellOutput04').innerHTML="Risk has had a previous bankruptcy"; } else if(z=="NO"){ document.getElementById('cellOutput04').innerHTML="Risk has never filed bankruptcy"; }
Comment