Code does not work in IE

They have: 2 posts

Joined: Aug 2011

Hello,

Please let me know why this code does not work in IE.
Works like a charm on Firefox, Chrome and other non IE browsers. :/

Much appreciated. I have attached the HTML file.

Regards,
Sam

They have: 2 posts

Joined: Aug 2011

<html>
<head>
<title>Sam</title>

<link rel="stylesheet" type="text/css" href="mystyle1.css" />

<script type="text/javascript">
function OnChange(chosenoption)
{

if (chosenoption.value!="nothing"){

document.f1.txt1.value += " // " +chosenoption.value;
}
}

</script>

</head>
<body>
<form name="f1">

<table id="rtblstyl" summary="test table">

<thead>
    <tr>
    <th scope="col" class="header-th">Test</th>
</thead>
<td>
abcd:
<select id="example" name=example onchange='OnChange(this.options[this.selectedIndex]);'>
<option value="abcdTxt2YES.">Yes</option>
<option value="abcdTxt2NO">No</option>

<option value="NA" SELECTED>NA</option>
</select>
</td>


<td>
This is something:
<select id="example" name=example onchange='OnChange(this.options[this.selectedIndex]);'>
<option value="Txt2YES.">Yes</option>
<option value="Txt2NO">No</option>

<option value="NA" SELECTED>NA</option>
</select>
</td>

</form>

</tr>
</table>

<textarea cols="40" rows="10" class="textarea1" NAME="txt1" ID="txt1"> Summary :- </textarea>
</body>
</html>

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.