Hi,

Just a minor javascript cross-browser hack.

When adding an options to a select tag using javascript, I can see in DHIS
you are doing like this :

 optionComboSelector.add( option, null );

This will only work on gecko-based browsers. For IE ( tested with IE 8  & 7
) it will throw error ,  the right one should be like this :

 optionComboSelector.add( option ); // only one param

So the solution should be :

   try {
        optionComboSelector.add( option, null );  // for gecko-based
browser...not tested with other webkit-based browsers ...
    }catch(e){
        optionComboSelector.add(option);  // just for IE
    }

A common method in common.js should be useful.

Regards,

-- 
Viet Nguyen
_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to