When I select 1 from dd1, it should not disable tb1. Otherwise, disable it. When the page is rendered the very first time, it shows value 1 in dd1 and 04/12/2010 in tb1. I blank out tb1 and change to 2 in dd1 and click submit button. It is supposed to grab all fields on the page and save them to the database. It grabs value 2 in dd1 correctly, but it grapbs 04/12/2010 instead of blank for tb1. Why is that?
If I remove the onchange attribute so that it doesn't invoke enableDisable(), then on submit it grabs the correct blank value for tb1. I don't know why enableDisable() would cause the problem. Does any one know?
<script language="javascript" type="text/javascript">
function enableDisable(sender, target) {
if (sender.value == "1") {
document.getElementById(target).disabled = false;
}
else {
document.getElementById(target).disabled = true;
...
Go to the complete details ...