Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript自动选项卡在iPad或iPhone上不起作用_Javascript_Iphone_Html_Ios_Ipad - Fatal编程技术网

Javascript自动选项卡在iPad或iPhone上不起作用

Javascript自动选项卡在iPad或iPhone上不起作用,javascript,iphone,html,ios,ipad,Javascript,Iphone,Html,Ios,Ipad,我有一段html代码: <form name="postcode" method="post" onsubmit="return OnSubmitForm();"> <input class="postcode" maxlength="1" size="1" name="c" onKeyup="autotab(this, document.postcode.o)" /> <input class="postcode" maxlength="1" size=

我有一段html代码:

    <form name="postcode" method="post" onsubmit="return OnSubmitForm();">
<input class="postcode" maxlength="1" size="1" name="c" onKeyup="autotab(this, document.postcode.o)" /> 
<input class="postcode" maxlength="1" size="1" name="o" onKeyup="autotab(this, document.postcode.d)" /> 
<input class="postcode" maxlength="1" size="1" name="d" onKeyup="autotab(this, document.postcode.e)" /> 
<input class="postcode" maxlength="1" size="1" name="e" /> <br />
    </form>
它使用以下javascript:

<script>
/*
Auto tabbing script- By JavaScriptKit.com
http://www.javascriptkit.com
This credit MUST stay intact for use
*/
function autotab(original,destination){
if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus()
}
</script><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"></script>
<script src="js/scripts.js" type="text/javascript"></script>

<script type="text/javascript">
function OnSubmitForm()
{
  if(document.postcode.operation[0].checked == true)
  {
    document.postcode.action ="plans.php";
  }
  else
  if(document.postcode.operation[1].checked == true)
  {
    document.postcode.action ="plans_gas.php";
  }
  else
  if(document.postcode.operation[2].checked == true)
  {
    document.postcode.action ="plans_duel.php";
  }

  return true;
}
</script>
当您在其中一个文本框中输入一个字符时,它会自动在下一个文本框中添加选项卡

这在pc或mac、safari以及所有其他浏览器上都可以正常工作。但是,当使用safari在iPad或iPhone上查看网页时,自动标签功能不起作用


关于如何使自动选项卡在这些移动设备上工作,有什么想法吗?

根据设计,据我所知,在mobile Safari中,focus在输入字段上被禁用。

在我上一次使用mobile Safari时,我需要用onKeyPress更改事件onKeyUp,你试过了吗?

你已经连续两次发布了这个问题。因此,我可能需要寻找另一种方法来集中精力,做同样的事情。。。