<input type="email">Language setting for validation errors

Asked 2 years ago, Updated 2 years ago, 43 views

It depends on the browser, but in the email address entry field
If there is no @ or after @,
An error appears, but

<!DOCTYPE html>
<html>
  <head>
    <metacharset="UTF-8">
  </head>
  <body>
    <form method="post">
      <input type="email" name="mailaddress">
      <input type="submit" value="send">
    </form>
  </body>
</html>

Is it possible to set the language of the error statement as desired?

html5

2022-09-30 16:16

1 Answers

You must use JavaScript to change the appearance and text of these messages.There is no way to change it only with HTML or CSS.
https://developer.mozilla.org/ja/docs/Web/Guide/HTML/Forms/Data_form_validation

That's right.

If you don't mind using js, I hope you can refer to it as it also says how to do it in this article.
I copied it and moved it, and it looks like the following.

Enter a description of the image here


2022-09-30 16:16

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.