Chrome5中的HTML5必填字段

时间:2012-07-11 18:59:12

标签: html5 validation google-chrome

我的表单中有一些required =“required”输入字段。它在Firefox中运行良好,但在Chrome中,当字段为空时它不会弹出任何错误,但仍然会阻止表单提交,这不是非常用户友好。我知道这种用法适用于旧版本的Chrome。

HTML:

<form method="post" id="contact-form" action="/kontakt">
                <div id="sylius_core_contact"><div class="form-field"><label for="sylius_core_contact_name" class=" required control-label">
    Ime i prezime
    </label><br><input type="text" id="sylius_core_contact_name" name="sylius_core_contact[name]" required="required"></div><div class="form-field"><label for="sylius_core_contact_email" class=" required control-label">
    Adresa e-pošte
    </label><br><input type="email" id="sylius_core_contact_email" name="sylius_core_contact[email]" required="required"></div><div class="form-field"><label for="sylius_core_contact_message" class=" required control-label">
    Poruka
    </label><br><textarea id="sylius_core_contact_message" name="sylius_core_contact[message]" required="required" rows="9"></textarea></div><input type="hidden" id="sylius_core_contact__token" name="sylius_core_contact[_token]" value="dc6f7bf332ad26f1cd9ae0aeba51f3ab4704578e"></div>
                <input value="Pošalji poruku" class="green-button" type="submit">
            </form>

新Chrome有什么问题?

1 个答案:

答案 0 :(得分:3)