The required attribute of the input tag in the HTML5 is changed to the __html of the English language.

Source: Internet
Author: User

Original source: Http://zhidao.baidu.com/link?url=bVzR5uJ0pHchYtnUAbwbjmfKwBi6tF52wjOqWQtyGddJ6ZpGbd4qPM7Q_ Pfiesd2qivd42yylvvbxf53zicrkvfd5mek1-n0ru1eewrrjja

We all know HTML5 for the input tag added required property, when submitting a form, if the required item is empty, then prompts the user that the item cannot be empty, now the question is this: I do is an English website, How to make this hint change English without changing the English system?

Best Answer

Input inside add such statements:
 required oninvalid= "setcustomvalidity" (' must be filled in. '); "oninput=" setcustomvalidity (");
 
" Hope can help you, if it helps you, please remember to take it in time, thank you
This answer is recommended by the questioner (1) 52 11

liushaofeng89

Adoption Rate: 42% from the team: Phtoshop Excel: Operating system/system fault image processing software system software Java-related data structure and algorithm other answers The original required did not consider the validation tests for local HTML5, rather than supplying their own custom tests.
If you do not want to use HTML5 type matching and pattern matching, then use the setcustomvalidity () and Oninvalid events:

<input type= "Text" pattern= "[a-za-z]+"

Oninvalid= "setcustomvalidity (' Custom message ')"/>

This setting, regardless of any of your supported HTML5 browsers, is displayed as a custom message, regardless of the local system language.
I hope I can help you.  Im King of the forest | 2014-02-10 17:41

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.