#823 ✓invalid

Invalid argument error IE8 and IE7

Reported by artazor | October 10th, 2009 @ 01:13 PM

I've prepared a simple test case which produces an error for me and some of my friends:


Expected result:

  • HtmlSelectElement displaying "I'm an option! - Will I be visible in IE8?"

Observer result:

  • Opera, FF, Chrome - all versions - as expected.
  • IE (see below) - fails with an "invalid argument" exception, displaying empty combo.


Prototype has been built from git yesterday 09-Oct-2009

1) Win2k8 64bit, IE 8.0.6001.18813
2) WinXP SP3 32bit, IE 8.0.6001.18702
3) WinXP SP2 32bit, IE 7.0.5730.11

Additional observations:

@@@ Javascript

var sel = $("IdOfMyHtmlSelectElement");
sel.options.add(new Element("option")); //works fine - inserts new empty option;
var opt = new Element("option").update("An option"); // also works fine;
sel.options.add(opt); // fails with "invalid argument" exception;
sel.options.add(new Element("option").update("An option")); // fails as well

The same with Element.insert

Comments and changes to this ticket

  • Tobie Langel

    Tobie Langel October 10th, 2009 @ 03:44 PM

    • State changed from “new” to “incomplete”

    Can you please submit a failing test case with Element.insert. The issue you're having with options.add is normal, it's behaviour is unspecified by the dom specs (afaik).

  • artazor

    artazor October 10th, 2009 @ 05:18 PM

    Thank you for pointitng to avoid using options.add - it was the main issue.

    Element.insert works fine if it's instead-of options.add

    It fails if used as Element.update with options.add: http://www.artazor.lv/testcases/case-2.html

    As soon as I repaced options.add with Element.insert all became fine: http://www.artazor.lv/testcases/case-3.html

    I have in mind that options.add stops working properly if an alement being added has been already updated whith Element.insert or Element.update. Without such updating options.add works properly in IE as well. But you are right - it is dangerous to use nonstandard things :]

    So you can close this ticket.

  • Tobie Langel

    Tobie Langel October 10th, 2009 @ 06:54 PM

    • State changed from “incomplete” to “invalid”
  • jayanthchandra176

    jayanthchandra176 January 12th, 2018 @ 03:29 PM

    • Importance changed from “” to “”

    Each team must spend at least 75 % of the salary cover (INR 60 crore) by the best of the two-day method. Kept players will have an even more dynamic effect on the team's salary handbags depending on amount of players taken care of by the franchise.
    The Chennai Super Kings are assemble to guard their main group including skipper Mahendra Singh Dhoni, Suresh Raina and Ravindra Jadeja money for crisis 11th release of IPL. However mature off-spinner Ravichandran Ashwin's opportunity of being encouraged through 'Right To Match' credit-based credit cards looks bleak. IPL Auction Live Streaming & Telecast 2018

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket