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