events - Javascript receive onmousedown of a disabled select tag -


i have form 2 radiobuttons:

[radio1]   [radio2] [select]  <input type="radio" id="radio1" name="radio" checked/> <br/> <input type="radio" id="radio2" name="radio"/> <select id="select" onmousedown="test()" disabled="disabled">     <option>aaa</option>     <option>bbb</option> </select> 

the desired behaviour when radio1 ticked, selectbox disabled. when radio2 ticked, user able select selectbox (hence enabled).

i have necessary event code in radio1 , radio2 handle enabled/disabling selectbox, , works nicely.

however, wanted additional behaviour: click selectbox, radio2 should ticked , selectbox enabled:

function test(){     document.getelementbyid('radio1').checked=false;     document.getelementbyid('radio2').checked=true;     document.getelementbyid('select').disabled=false; } 

however, test() never gets called while selectbox disabled. there other event this?

the alternative solution put transparent overlay on selectbox handle events (and hide when selectbox enabled).

i think expected. disabled input elements not respond mouse (and other) events. can try overlay solution - should work if select disabled.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -