The problem is within the code I provided, which carried over to the code you are using.
Sorry, I sometimes forget which language I'm coding in, and use the wrong constructs.
Try it this way:
Code:
<script type="text/javascript" language="javascript">
function showfield(what) {
if(what.id == "cb1" && what.checked) {
document.getElementById('text1').style.display = "inline";
}
else if(what.id == "cb1" && !what.checked) {
document.getElementById('text1').style.display = "none";
}
else if(what.id == "cb2" && what.checked) {
document.getElementById('text2').style.display = "inline";
}
else if(what.id == "cb2" && !what.checked) {
document.getElementById('text2').style.display = "none";
}
else {
document.getElementById('text1').style.display = "none";
document.getElementById('text2').style.display = "none";
}
}
</script>
In javascript, a single equal sign will assign the value on the right to the variable on the left. In order to test equivalency, you need two equal signs, together.
Doing a lot of work in VBScript, recently, which uses a single equal sign for everything.