Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Select() method unsupported in Safari




Actually, you could store away the selection, and restore it once an item is selected in the dropdown.


The same problem exists with multiple selections in iframes and dropdowns... in all browsers except Safari, you can have separate selections for each frame/iframe. This is a common problem that WYSIWYG editors have with Safari, for example, you can select a text then choose a new font type from a dropdown. Think this is reported as a bug btw.

Regards,
Joakim L
Moxiecode Systems


Niels Meersschaert wrote:
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

This email sent to 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>)



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.