Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parsley custom error message doesn't work

I have the following input field:

<input id="name" name="real_name" type="text" placeholder="ie. Your full name or company name" class="form-control input-lg parsley-validated"
   data-required="true" parsley-error-message="Please insert your name" >

However, when I press my submit button, I only get the standard This value is required. message.

Can anyone tell me why?

like image 983
Marc Rasmussen Avatar asked Jan 27 '14 22:01

Marc Rasmussen


People also ask

How do I get rid of parsley error?

According to Parsley Documentation in their version 2, they already supported this features, just add "data-parsley-errors-messages-disabled" attribute to the <form> tag. Save this answer.

What is data parsley validate?

Parsley is a javascript form validation library. It helps you provide your users with feedback on their form submission before sending it to your server. It saves you bandwidth, server load and it saves time for your users.


2 Answers

Try

data-parsley-required-message="Please insert your name"

like image 157
Ankit Sharma Avatar answered Oct 06 '22 05:10

Ankit Sharma


Try this attribute instead of parsley-error-message:

data-parsley-required-message="Please insert your name"

It's not a custom error message for custom validator. You need to override the default 'required' error message with your one.

like image 43
vitkon Avatar answered Oct 06 '22 04:10

vitkon