1

I searched for the messages shown for validations and couldn't find them in the entire project.

For example when I enter some value without @ sign to the <input type="email" /> I get the validation error:

please include an @ in the email address

But I'm not able to find this message anywhere.

I'm trying to translate and localize these messages.

Ashkan Mobayen Khiabani
  • 33,575
  • 33
  • 102
  • 171

1 Answers1

0

It is a default HTML input validation message. when we use required at the end of the html form input tag, it gives us specific validation message of specific input type.. for example

<input type="text" name="usrname" required>

in this case it will give this message

please fill out this field

for your case

<input type="email" name="usrname" required>
in this case for submitting the form it will give this validation message

please include an '@' in the email address

here the required attribute is a boolean attribute. When present, it specifies the user is required to select a value before submitting the form.

  • what I want to do is to translate the message to another language. not change the validation type. – Ashkan Mobayen Khiabani Nov 14 '16 at 16:48
  • in this case you should use javascript to do that.. for example – Tanvir Hossain Nov 14 '16 at 17:03
  • in this case you should use javascript to do that.. for example in html tag ` ` just like that, declare id for input tag and span tag, and in script tag you should call those id and set value for custom validation message .. **First Name can not be blank** – Tanvir Hossain Nov 14 '16 at 17:09