使用asp:textbox的iPhone数字文本字段 [英] iPhone numeric textfield using asp:textbox
本文介绍了使用asp:textbox的iPhone数字文本字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为iPhone构建一个Webapp.我已经测试过<input type="number"
...使iPhone显示数字键盘.如何使用<asp:TextBox
创建相同的行为?
Building a webapp for iPhone. I have tested that <input type="number"
... makes the iPhone display a numeric keyboard. How is that same behaviour created using <asp:TextBox
?
如果我使用HTML <input
字段,它已经可以在iPhone上使用了.应该可以使用asp:Textbox
It already works on the iPhone if I use HTML <input
field. It should be possible using the asp:Textbox
推荐答案
如果它是一个Web应用程序,那么它将如何特别适用于iPhone?您可以编写JavaScript以仅接受数字,或使用验证程序控件仅强制执行数字,但我认为没有比这更快的内置方式了.
If it''s a webapp, then how can it be for iPhone particularly ? You can write javascript to only accept numbers, or use a validator control to enforce only numbers, but I don''t think there''s a quicker, built in way than that.
尝试:
<asp:TextBox id="test" runat="server" pattern="[0-9]*" />
但仅适用于Safari 3.1!您应该阅读苹果参考资料.
but is is working with safari 3.1 only! You should read apple reference for this.
这篇关于使用asp:textbox的iPhone数字文本字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文