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:
line number on/offcode: select all 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 bothOnclickAnd onselect trying to make it work ).
The javascript code is in a file called util. js. This is the code: line number on/offcode:SelectAllfunction DM (){
Alert ("OK ");
Document. newmalform. menub. Disabled = "disabled ";
Return;
}
Function RM (){
Alert ("OK ");
Document. newmalform. menub. Disabled = false;
Return;
}
The Javascript file is wrongly ded using this tag: line number on/offcode:SelectAll <SCRIPT type = 'text/JavaScript 'src = 'util. js' Language = 'javascript '> </SCRIPT>
Now, thisWorks in Firefox but not in IE.
In fact, ie doesn' t even run the functions as the alert (called in
Javascript file) isn' t shown when I click the menu options. What is
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.
---- Solve
Remove the events fromOptions, Use an event directly onSelectInstead.
Internet Explorer treatsSelect
Boxes slightly different than the rest of the document, (if you 've ever
Read anyhting about "Your wed controlls" you know what I'm talking
About)
I'm thinking ie doesn't notice events in childnodesSelectElements, onlySelectElements themselves.
I normally setup my functions to work depending on either of the selectsValueOrSelectedindexAttribute & usingOnchangeEvent.
Line number on/offcode: Select All
Function DIS (state ){
VaR disstate = State = 1;
Alert (disstate );
}
...
select onchange = "dis (this. selectedindex) ">
Option disabled Option
Option enabled Option
select