[英]JSF 2.1 inputText type attribute
We are working with JSF 2.1, and upgrading to JSF 2.2 is not an option at this time. 我们正在使用JSF 2.1,目前还不能升级到JSF 2.2。 For our application forms, I want to be able to add a type attribute to the inputText tags, so that mobile users will be presented with the correct keyboard for the data they are about to enter. 对于我们的申请表,我希望能够向inputText标签添加一个type属性,以便向移动用户提供正确的键盘,以显示他们将要输入的数据。
<h:inputText id="textID" type="text" value=""></h:inputText>
<h:inputText id="phoneNum" type="tel" value=""></h:inputText>
<h:inputText id="email" type="email" value=""></h:inputText>
How can I make this following rendered HTML happen with JSF 2.1? 如何使以下呈现的HTML在JSF 2.1中发生?
<input id="textID" type="text" value=""/>
<input id="phoneNum" type="tel" value=""/>
<input id="email" type="email" value=""/>
How can I make this following rendered HTML happen with JSF 2.1? 如何使以下呈现的HTML在JSF 2.1中发生?
See more about validator email example here email validator example 查看更多有关此验证电子邮件例如电子邮件验证实例
Or you can use primefaces inputText tag that make you able to use : tel , email as value of the attribut type like this : 或者,您可以使用primefaces inputText标记,使其能够使用:tel,email作为属性类型的值,如下所示:
<p:inputText type="email" value="#{userBean.userName}" />
<p:inputText type="tel" value="#{userBean.telephone}" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.