473,609 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opera Bug? Unselecting/removing options

Using the latest version of Opera 8.5, this test case:

--------------------------------------------------------
<select name="sel" multiple="true" size="3">
<option value="option1" selected>option 1</option>
<option value="option2" selected>option 2</option>
<option value="option3" selected>option 3</option>
</select>

<input type="button"
value="Unselect the first option, then remove the second option"
onClick="this.f orm.sel.options[0].selected=false ;this.form.sel. options[1]=null;">
--------------------------------------------------------

results in the 2 remaining options to both be selected.
However, the first option should no longer be selected.

Am I wrong, or is this an Opera bug?
Or is this somehow acceptable behavior?

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Dec 17 '05 #1
8 2158

Matt Kruse wrote:
Using the latest version of Opera 8.5, this test case:

--------------------------------------------------------
<select name="sel" multiple="true" size="3">
<option value="option1" selected>option 1</option>
<option value="option2" selected>option 2</option>
<option value="option3" selected>option 3</option>
</select>

<input type="button"
value="Unselect the first option, then remove the second option"
onClick="this.f orm.sel.options[0].selected=false ;this.form.sel. options[1]=null;">
--------------------------------------------------------

results in the 2 remaining options to both be selected.
However, the first option should no longer be selected.

Am I wrong, or is this an Opera bug?
Or is this somehow acceptable behavior?


It behaves as expected in Opera 7.54 but not in 8.51.
If it helps, reversing the order of the instructions clears the problem
--
S.C.

Dec 17 '05 #2
On 17/12/2005 20:41, Matt Kruse wrote:

[snip]
<input type="button"
value="Unselect the first option, then remove the second option"
onClick="this.f orm.sel.options[0].selected=false ;this.form.sel. options[1]=null;">
[snip]
Am I wrong, or is this an Opera bug?


It would seem to be. The behaviour is the same using the remove method
as well. Reversing the order of the operations (remove first) avoids the
problem.

Have you reported this?

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Dec 17 '05 #3
Michael Winter wrote:
Am I wrong, or is this an Opera bug?

It would seem to be. The behaviour is the same using the remove method
as well. Reversing the order of the operations (remove first) avoids
the problem.
Have you reported this?


I just did, yes. I was doing some regression testing and grabbed the latest
Opera. I was shocked to find it erroring out on such simple things. I
thought maybe I was missing something obvious.

It looks like when an option is removed, all options are set back to their
'defaultSelecte d' status. Bummer. They can spend lots of hours on gestures
and skins, but can't get basic options collections working right :)

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Dec 18 '05 #4
VK

Matt Kruse wrote:
Michael Winter wrote:
Am I wrong, or is this an Opera bug?

It would seem to be. The behaviour is the same using the remove method
as well. Reversing the order of the operations (remove first) avoids
the problem.
Have you reported this?


I just did, yes. I was doing some regression testing and grabbed the latest
Opera. I was shocked to find it erroring out on such simple things. I
thought maybe I was missing something obvious.

It looks like when an option is removed, all options are set back to their
'defaultSelecte d' status. Bummer. They can spend lots of hours on gestures
and skins, but can't get basic options collections working right :)


I guess that while refactoring SELECT (on add/remove options) Opera
gives priority to hardcoded settings over runtime scripted properties.
If *all properties* are runtime scripted then it works as expected:

<html>
<head>
<title>Untitl ed Document</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFF F">
<form method="post" action="">
<select name="sel" size="3" multiple>
<option value="option1" >option1</option>
<option value="option2" >option2</option>
<option value="option3" >option3</option>
</select>

<input type="button"
value="Unselect the first option, then remove the second option"
onClick="
with (this.form.sel) {
options[0].selected = true;
options[1].selected = true;
options[2].selected = true;

options[0].selected=false ;
options[1] = null;
}
">
</form>
</body>
</html>

Opera team always positionned themselves as holly keepers of *true* CSS
ans HTML layout rules. So you may file a complain but I guess that the
response (if any) will be a la PointedEars bunch of doc quotes and
explanations how one really should read them.

P.S. Also note that "multiple" is a flag and not an attribute/value
pair. Opera is rather picky on it, so say multiple="on" is ignored as
invalid declaration.

Dec 18 '05 #5
On 18/12/2005 09:22, VK wrote:

[snip]
Opera team always positionned themselves as holly keepers of *true*
CSS ans HTML layout rules.
No, they just try to produce a decent browser that implements the
relevant standards as closely as feasible. A laudable goal for any
browser vendor.

[snip]
P.S. Also note that "multiple" is a flag and not an attribute/value
pair. Opera is rather picky on it, so say multiple="on" is ignored as
invalid declaration.


I didn't notice that mistake in Matt's original post. It wasn't the
focus of my attention.

Indeed, boolean attributes in HTML do not have values like yes/no,
true/false, or on/off. The mere presence of the attribute itself
indicates true, and its omission, false. If it is given a value, that
value must be itself. That is,

<select ... multiple="multi ple">

However, the value is better omitted in HTML.

That said, it makes no difference with regard to the observed behaviour
in this case.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Dec 18 '05 #6
VK

Michael Winter wrote:
No, they just try to produce a decent browser that implements the
relevant standards as closely as feasible. A laudable goal for any
browser vendor.


The OP question was "is this SELECT behavior a bug to report or an
intentional feature". Actually it was not a question but a statement:
"this is a bug".

It seems though that it is an intentional feature as illustrated by my
test case: HTML-hardcoded attributes have priority over scripted ones.
This behavior is reproducible up to the most recent Opera 8.51

It is a shame that this issue appeared too close to the holidays.
I'm pretty much sure that the behavior choice both in Firefox and Opera
has been made based on the same documents from the same W-known
organization. One could ask for official Mozilla Foundation reading of
the relevant paragraphs, then the same from Opera, then ask some local
standards' guru to comment on both positions. That would be a lot of
evangelism Christmas fun we're going to miss now :-(
:-)

Dec 18 '05 #7
On 18/12/2005 15:01, VK wrote:

[snip]
The OP question was "is this SELECT behavior a bug to report or an
intentional feature".
That's paraphrased, but essentially correct.
Actually it was not a question but a statement: "this is a bug".
I think it really was a question. Matt may have been of the opinion that
is a bug, but wanted a second opinion nevertheless. You'd have to ask
him, though.
It seems though that it is an intentional feature as illustrated by my
test case: HTML-hardcoded attributes have priority over scripted ones.
This behavior is reproducible up to the most recent Opera 8.51


No, it isn't. It is a new 'feature' in Opera 8.x only. No other version
I have, from 6.06 to 7.54, behaves the same way. That may indicate
either a fundamental change of opinion within the development team, or a
bug that slipped through regression testing - something that only Opera
Software can comment upon.

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Dec 18 '05 #8
VK

Michael Winter wrote:
No, it isn't. It is a new 'feature' in Opera 8.x only. No other version
I have, from 6.06 to 7.54, behaves the same way. That may indicate
either a fundamental change of opinion within the development team, or a
bug that slipped through regression testing - something that only Opera
Software can comment upon.


Yes, guessing game doesn't help too much. As an Opera-specific fix one
could use:
selectObject.op tions[i].defaultSelecte d = false;
selectObject.op tions[i].selected = false;
That naturally raises other problems later like form reset behavior.

Interestingly enough explicit attribute removal doen't help:

sel.options[0].removeAttribut e(sel.options[0].attributes['SELECTED']);
doen't produce any error by behavior-wise is silently ignored.

As you already noticed, w/o Opera, Inc. direct answer it is a pure
speculation, but the whole behavior seems to be too "logic consistent"
for a bug. I'm still affraid that someone in Opera team read W-paper in
the direct rather than in abstractically-spiritual way.

Dec 18 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4693
by: Pete Gray | last post by:
I have this in my style sheet: ..intro { font-size:1.2em; font-family:"Comic Sans MS", cursive; letter-spacing:0.1em; } p.intro:first-letter {
18
5623
by: David Morris | last post by:
G'day. Is there a known "display:block;" problem in opera? In playing around trying to get some cross browser conformance, I either inadvertently or redundantly (depending on your perspective) added "display:block;" to a style defining tables that also had zero padding, margin and border. With "xdisplay:block;" (that is nothing) all browsers (well Ie6, MZ, Ff Op in
7
2053
by: Warren Post | last post by:
I´m trying to implement a:hover popup images like Eric Meyer did at <http://meyerweb.com/eric/css/edge/popups/demo2.html>. My latest take is at <http://www.cafecopan.com/dev/20050612/index.en.html>. Mozilla 1.6 and even MSIE 6.0 display as intended: upon hovering over the text on the right, a corresponding image pops up on the left, covering the default image. Opera 7.53 however, truncates the lower portion of the hover image, allowing...
10
21872
by: SueB | last post by:
Hi. Is there a way to "unselect" items in a listbox, programmatically? Here's what I want to do (and I've been trying to to this while debugging the form, but I've been unsuccessful) ... I have a form with two listboxes. The form, also, has two option buttons in an options group: 1 button for
0
1001
by: Ramesh Chawla | last post by:
Hi, I am making a table in ASP.NET at the runtime and loading the data in the left and the most colums and in between there are 9 columns on which data from either of the columns can be dropped. For that what I am coding is that, on mouse-down and function called GetValue() is called and on mouse-up the function SetValue() is called. In GetValue() I am getting the innertext of the cells and in SetValue() I am setting the innertext on the...
24
4368
by: RyanTaylor | last post by:
I have a final coming up later this week in my beginning Java class and my prof has decided to give us possible Javascript code we may have to write. Problem is, we didn't really cover JS and what we covered was within the last week of the class and all self taught. Our prof gave us an example of a Java method used to remove elements from an array: public void searchProcess() { int outIt=0;
6
2710
by: Jeremy | last post by:
I really want to make my scripts work in Opera. I really, really do. But it seems like an uphill struggle. First of all, I can't get ANY kind of debug output. No error messages in the "javascript console" - but then, I have never seen ANYTHING in Opera's javascript console. Is there some kind of voodoo I need to perform in order to make that work? Then, when Opera doesn't like something about a script (even if it works fine in...
7
1291
by: Dr J R Stockton | last post by:
I've heard that at <URL:http://www.merlyn.demon.co.uk/js-clndr.htm#P> and using Opera the suffixed dates in the yellow box appear in a single long line instead of in the obvious weekly manner. It's OK in IE 4 & 6. That sounds as if if (++k%7==0) document.writeln() is not working in Opera. Any explanation and/or suggestions? In particular, I'd like to know whether the circumstances will apply elsewhere on the site.
5
2307
by: Doogie | last post by:
Hi, I have a listbox set up so users can select multiple choices. I want to limit them so they can choose no more than 4 at a time. I have set up javascript code to do the check on the number of choices selected but what I want to do is if they choose more than 4 (i.e. 5), I want to unselect the last item they selected. I cannot figure out how to determine which was the last item selected. function HasExceededMaximumYearWeekCount() {
0
8095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8588
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8556
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6068
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2541
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1690
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1407
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.