“输入类型=日期” iOS上的占位符? [英] "input type=date" placeholder on iOS?

查看:208
本文介绍了“输入类型=日期” iOS上的占位符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个针对iPhone / iPad的网站。

I'm currently developing a website aimed at iPhones/ iPads.

将输入类型设置为日期会将字段外观更改为下拉菜单,而使用文本字段的占位符属性仅显示在桌面版本上,而不是显示在苹果手机。有没有解决的办法?

Setting the input type to date changes the field appearance to a drop down menu, and the placeholder attribute that works with text fields only shows on the desktop version, not on the iphone. Is there a way around this?

这是目前的样子; http://i44.tinypic.com/2u91xsz.png

我想摆脱那个结束日期文本,并且有类似于它上面的下拉菜单。

I want to get rid of that closing date text and have something similar to the dropdown menu above it.

它基本上只是让我可以让用户知道他们输入的是什么,而不需要在屏幕上使用任何额外的空间,所以它不是最大的问题,如果那里没有解决方案。

Its basically just so that I can let the user know what they are entering without the need to use any extra space on the screen, so its not the biggest issue if there is no solution.

推荐答案

我花了一段时间搞清楚这一个,把它保留为type =text,并添加onfocus =(这个.type ='date')

Took me a while figuring this one out, leave it as type="text", and add onfocus="(this.type='date')"

我甚至喜欢我见过的onblur

i even like the onblur i've seen mentioned

<input placeholder="Date" class="textbox-n" type="text" onfocus="(this.type='date')" onblur="(this.type='text')" id="date">

这篇关于“输入类型=日期” iOS上的占位符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆