It seems to be consistent with all of the doctypes.
Here is the code that I use to recreate the problem.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- other doctypes -->
<!--
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>javascript_bug</title>
<script type="text/javascript" charset="utf-8">
function setElement()
{
var select = document.getElementById('list');
select.options[3].selected = true;
}
</script>
</head>
<body>
<h2> Form </h2>
<form action="" method="get" accept-charset="utf-8">
<select id="list">
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
<option>Option 4</option>
<option>Option 5</option>
</select>
<input type="button" name="some_name" value="Change the selected
index" id="some_name" onclick="setElement()">
</form>
</body>
</html>
On 22 Aug 2007, at 10:38 AM, Nico du Plessis wrote:
Have you logged a bug report with Apple yet?
On 22 Aug 2007, at 9:46 AM, Nico du Plessis wrote:
Funny you should send this mail.
I have just been sitting here for an hour trying to figure out
what I am doing wrong in my javascript.
I have the same problem
Regards,
Nico du Plessis
On 22 Aug 2007, at 6:38 AM, Lee Hinde wrote:
I posted this on the jQuery list with no love, so I thought I'd
try here:
Hi;
Based on this conversation: http://tinyurl.com/2qwpna
I've added this code to my page
function updateColor()
{
var currentColor = $("#setColorKey").val();
$("#color_Key option").each(function()
{
// $(this) is the current <option> element
var thisValue = $(this).val();
if (thisValue == currentColor){
$(this).attr("selected", true);
//safari logging.
if(window.console)
{window.console.log($(this).attr("selected")+" "+thisValue);}
return false;
}
});
}
The problem is, on Safari 3. the option doesn't get selected. It
works
fine in Firefox/Camino.
The Safari javascript console shows the log entry, but doesn't
update
the select.
--
"And those are my principles. If you don't like them, I have
others" -
Groucho Marx
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Web-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Web-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Web-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Web-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40xfer.info
This email sent to email@hidden