if the option already exists and you just want it to be selected, it would be something like this (if "sel" were the id of your select and you wanted the 3rd option selected):
Code:
document.getElementById("sel").selectedIndex=2;
you can also give your options id's and select them that way:
Thanks guys, got it working perfectly but my problem is how to dynamically selected the a default value, I have tried using ternary operator inside the constructor but it didnt work.
eg.
document.frmadd.subcat.options[3]= new Option("Weddings", "8", false, (frmadd.subcat.value == '8')?true:false)
Bookmarks