Mozilla listbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • danblack101
    New Member
    • Apr 2007
    • 2

    #1

    Mozilla listbox

    Hi,
    I've searched high and low for an answer but have had no luck.
    I want to add an item to my listbox. The following code works fine in IE but has no effect in Mozilla.

    document.getEle mentById("ListB ox1").add(new Option("Text"," Value"));

    Thanks
    Dan
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Welcome to TSDN!

    IE doesn't follow the standards. For Mozilla and standards-compliant browsers, you will need to put a null parameter. This won't work in IE, so you need to catch the exception and use the IE method in the catch statement. See link.

    Comment

    • danblack101
      New Member
      • Apr 2007
      • 2

      #3
      Originally posted by acoder
      Welcome to TSDN!

      IE doesn't follow the standards. For Mozilla and standards-compliant browsers, you will need to put a null parameter. This won't work in IE, so you need to catch the exception and use the IE method in the catch statement. See link.

      Thanks mate looks ideal!!
      Much appreciated
      Dan

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        No problem. You're welcome.

        Comment

        Working...