Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H5中input type='search' 但键盘不显示‘搜索’按钮的解决办法 #5

Open
jinjiaxing opened this issue Jan 17, 2018 · 0 comments

Comments

@jinjiaxing
Copy link
Owner

H5 input type="search" 不显示搜索 解决方法

在IOS(ipad iPhone等)系统的浏览器里打开H5页面。如下写法:

<input type="search" name="search” id="search"> 

以上设备的键盘仍然显示“换行”。

解决方法如下:在input外面嵌套一层form:

<form action="">
    <input type="search" name="search" id="search">
</form>

其中form 必须有action。

如果你不想要action,因为它可能影响了你input的提交逻辑,可以重写一下onsubmit onclick等方法来实现。

也可以用简单的方法:action="javascript:return true;"。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant