So I have an input text in my html form, that is marked required
. My basic question is - are there any options to change the info text of the message. So instead of the default Please fill out this field
I want to set my own messages. Eg: User name exists
(for Registration forms) or Email Exist
, Too weak Password
, etc.
I want to be able to do it in jQuery as well.
Here is my HTML:
<input type="email" placeholder="Email" required="required">
What are my options?
Updated
So this is my solution for jQuery but it didn't work as expected
$('#register').first(function() {
$(this).attr("oninvalid", "setCustomValidity('This Email has been already register')")
});
What I do wrong? I want to take the form with id register
get the first input
and add the oninvalvid
parameter