Option onClick in Internet Explorer
In a page that I am working on right now I have this problem:
I have a dropdown menu using select. This menu has two options. What I want to happen is that when I click the first option another dropdown menu (let us call it B), is disabled. And when I click the second option, menu B is enabled. I've tried to solve it this way:
<option onClick='dm();' onSelect='dm();' value='DM'>Option 1</option>
<option onClick='rm();' onSelect='rm();' value='RM'>Option 2 </option>
</select>
- <select name='Type'>
- <option onClick='dm();' onSelect='dm();' value='DM'>Option 1</option>
- <option onClick='rm();' onSelect='rm();' value='RM'>Option 2 </option>
- </select>
(As you can see, I've defined both onClick and onSelect trying to make it work).
The javascript code is in a file called util.js. This is the code:
alert("OK");
document.newMalForm.menuB.disabled="disabled";
return;
}
function rm(){
alert("OK");
document.newMalForm.menuB.disabled=false;
return;
}
- function dm(){
- alert("OK");
- document.newMalForm.menuB.disabled="disabled";
- return;
- }
- function rm(){
- alert("OK");
- document.newMalForm.menuB.disabled=false;
- return;
- }
The javascript file is included using this tag:
Now, this works in firefox but not in IE. In fact, IE doesn't even run the functions as the alert (called in the javascript file) isn't shown when I click the menu options. What is the problem?
EDIT: The alert only exists in debug purpose. And I also wanted to say that this is my first post in this forum!
More editing, to clarify: newMalForm is the form that contains both of the dropdown menus.