IPhone Sofari JavaScript Event

IPhone Sofari JavaScript Event

These days, we came across a problem about sofari browser on iphone system.

We capture the 'Next' button clicking on iphone system with event onfocus


<html>
<head>
    <script type="text/javascript">
        function OnFocusInput(input) {
          input.value = input.name + " in red";
            input.style.color = "red";
        }

        function OnBlurInput(input) {
            input.value = input.name + " in blue";
            input.style.color = "blue";
        }
    </script>
</head>
<body>
    <input type="text" name="text1" onfocus="OnFocusInput(this)" onblur="OnBlurInput(this)" value="Custom input field"/><br />
    <input type="text" name="text2" onfocus="OnFocusInput(this)" onblur="OnBlurInput(this)" value="Custom input field"/><br />
    <input type="text" name="text3" onfocus="OnFocusInput(this)" onblur="OnBlurInput(this)" value="Custom input field"/><br />
    <select name="select1" onfocus="OnFocusInput(this)" onblur="OnBlurInput(this)">
    <option value="1">1</option>
    </select>
    <br />
    <select name="select2" onfocus="OnFocusInput(this)" onblur="OnBlurInput(this)">
    <option value="2">2</option>
    </select>
</body>
</html>


references:
http://help.dottoro.com/ljjhfrjd.php

你可能感兴趣的:(iPhone,sofari)