| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Regards, Joakim L Moxiecode Systems
What you're trying to do is not working because you are sending conflicting settings. When the user does a mousedown over the dropdown, the dropdown has focus. The user is always in charge of focus. You can only alter focus if the user isn't setting focus themselves. Instead of using the text selected, you might consider using a css change to provide some highlighting of the text.
Niels
On Mar 7, 2006, at 2:27 PM, Vid Boi wrote:
<html>
<head>
<script type="text/javascript">
function selectText()
{
document.getElementById("textField").focus();
document.getElementById("textField").select();
}
function changeText(elem)
{
var mammal =
elem.options[elem.selectedIndex].value;
document.getElementById('textField').value =
"The " + mammal + " is on the mat";
}
</script>
</head>
<body>
<form>
<input size="40" type="text" id="textField"
value="The cat is on the mat" />
<select id="timerPopup"
onmousedown="selectText()"
onchange="changeText(this)">
<option value="cat">cat</option>
<option value="bat">bat</option>
<option value="rat">rat</option>
</select>
</form>
</body>
</html>
------------------------------------------------------------------------
_______________________________________________ Do not post admin requests to the list. They will be ignored. Web-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/web-dev/email@hidden
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: http://lists.apple.com/mailman/options/web-dev/email@hidden
| References: | |
| >Re: Select() method unsupported in Safari (From: Vid Boi <email@hidden>) | |
| >Re: Select() method unsupported in Safari (From: Niels Meersschaert <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.