【问题标题】:Form validation and design on iPadiPad 上的表单验证和设计
【发布时间】:2016-01-28 05:49:19
【问题描述】:

我知道这个问题不是特定于编程问题,而是关于一般的编程和设计。

我正在编写一个将在单个 iPad 设备上使用的网络应用程序(目前无论如何),但我在两件事上遇到了麻烦:表单验证和表单设计。

首先,我无法在 iPad 上使用 HTML5 进行表单验证。它在 pc 上运行良好,但在 safari 或 iPad 上的 chrome 上完全没有。提交表单不会触发验证错误,CSS 无法识别:invalid 伪标签。我如何工作? jquery 的 h5Validate 似乎不起作用。这是我的代码:

        <form action="/contact_submit.php" method="post" autocomplete="off">
            <label for="name">Name:</label>
            <input id="name" name="name" type="text" required autocorrect="off" autocaptialize="words" autofocus maxlength="30" inputmode="latin-name" placeholder="Full Name">
            <label for="email">Email:</label>
            <input id="email" name="email" type="email" autocorrect="off" maxlength="75" inputmode="email" placeholder="jon@sample.com">
            <label for="tel">Phone:</label>
            <input id="tel" name="tel" type="tel" required inputmode="tel" maxlength="11" placeholder="2285555555">
            <label for="message">Message:</label>
            <textarea id="message" name="message" autocapitalize="sentences" placeholder="Any additional information you'd like us to know"></textarea>
            <button id="submit" type="submit">Send</button>
        </form>

其次,更多的是一个附带问题,我不擅长表单设计的创意方面,那么是否有任何 jquery 或其他预先开发的解决方案用于信息亭上的表单布局?

【问题讨论】:

    标签: css html forms validation ipad


    【解决方案1】:

    我最终发现,由于 iPad 没有正确使用表单验证,我不得不手动将验证类添加到 h5validation 脚本中,如文档中所述。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-29
      相关资源
      最近更新 更多