On May 7, 6:18 am, grpramodku...@gmail.com wrote:
> HI,
>
> function change(value,sub) {
> subcat = document.getElementById(sub);
> subcat.options.value = value;
>
> }
>
> <select id="aa">
> <option value="1">one</option>
> <option value="2">two</option>
> </select>
>
> <input type="button" value="Click" onclick="change(2,'aa');">
>
> I am trying to change the value of a select box dynamicaly on click ,
> the above code is working in IE , but not in firefox,
>
> Thanks,
I don't get it at all... You want ALL the options to have the same
value as specified in the 1st parameter of the function??
Then this workaround is 100% surely will work in both Firefox,
Explorer and Konqueror ( I've tested it

).
function change(value, sub)
{
var subCat = document.getElementById(sub);
var childArray = subCat.childNodes;
for(i = 0; i < childArray.length; i++)
childArray[i].value = value;
}
Would you please be more specific about your requirement?