From: Brad C. <yo...@br...> - 2004-10-27 22:54:00
|
Since it works sometimes I really can't tell you much without seeing it fail. Why are you doing this anyway? :) Brad C --- Vinay Murthy <vin...@gm...> wrote: > Hi, > I am trying to append an option into a drop down list using > HtmlSelect's appendOption. > Is there a reason why this might not work on a list ? > This is what I am trying to do: > > HtmlSelect dropDownList = (HtmlSelect)myForm.getSelectByName("cars"); > Map attributesMap = new HashMap(); > attributesMap.put("text","ford"); > attributesMap.put("value","FORD"); > HtmlOption newOption = new HtmlOption(myPage,attributesMap); > dropDownList.appendOption(newOption); > > myPage contains myForm which in turn contains dropDownList > > This works on a testpage(page on my machine) but when I try a similar > thing on a different site, I am unable to add the new option. I looked > into the options in the drop down list using > dropDownList.getAllOptions(). > > Best Regards > Vinay |