Questions tagged [parsley.js]

Parsley.js is a Javascript library that provides an easy interface for form validation using HTML5 data attributes. Currently available as a plugin for jQuery.

Parsley.js is a Javascript library to validate forms built on top of jQuery.

Feature Overview:

  • Dynamic form validation
  • Cross-browser
  • Built-in validators for the most common cases
  • Allows you to craft your own validators
  • Allows you to create remote (ajax) validators
  • Provides events so you can customize you validation process as much as possible

Documentation & Links

753 questions
6
votes
1 answer

Display parsley errors in bootstrap tooltip

I'm using parsley 2.0.0-rc5 and want display the error messages in a bootstrap tooltip. I'm using "parsley:field:error" but the event fires before the error is displayed in error-container and I can't pick up the error. Someone an idea how I get the…
5
votes
1 answer

Change fields back to valid after invalidated by parsley

I have the following custom validator. The intended purpose is to validate the field contingent upon the value of the field passed in as 'requirement'. The 'requirement' field updates onchange of the FieldToBeValidated. In order to prevent the…
Blake Yarbrough
  • 2,286
  • 1
  • 20
  • 36
5
votes
1 answer

Add custom multiple validations with Parsley

Is it possible to add a custom multiple validation (i.e. a single validation that depends on multiple inputs) with Parsley? I sometimes would like to validate a
or a section as a whole and provide an error at that level instead of at the…
Marc-André Lafortune
  • 78,216
  • 16
  • 166
  • 166
5
votes
1 answer

Parsley Date Format

I am currently setting up a form with a field with Parsley to validate that the date cannot be in the past. However, I am unable to get it to validate despite giving it the correct values(in the future). It seems to read the…
Hong Yi
  • 569
  • 2
  • 13
  • 29
5
votes
1 answer

Validate set of fields only if radio button is checked (conditional validation)

I have a form with two sets of fields: "Contact information" (17 fields) "Company information" (5 fields) There is a radio with the question "Do you have a company?" that is related to the company information. If the radio is "Yes", the company…
ZioTonio
  • 79
  • 2
  • 10
5
votes
3 answers

Need to require only one of a group of fields with Parsley

I am using Parsley.js for validating a form submission on a project. One of my needs is to have Parsley require that at least one of three fields have data in them, and only fail validation if none of the three fields has data. I am not sure from…
NilsonCain
  • 101
  • 7
5
votes
1 answer

Parsley JS Add Error/Success Class to Parent

I'm using Parsley JS (http://parsleyjs.org/) for form validation. The default behavior for errors is to add a class of parsley-error to each invalid input. However, I'd like to change up the default behavior and add the error class to the parent of…
cusejuice
  • 10,285
  • 26
  • 90
  • 145
5
votes
1 answer

How to trigger validation before submission in parsley?

I'm now using parsley 2 to validate my form, it works fine except this problem: only after you submit your form for the first time, the validation will be triggered when you change your input, but before submission, it will do nothing. That said, I…
Sefier Tang
  • 770
  • 3
  • 8
  • 25
5
votes
2 answers

how to only allow text in parsely.js validation

I am using the nifty parsley js As you can see in the documentation there is only data-parsley-type="alphanum" which allows numbers and letters. I am trying to create fields that ONLY allow letters. Anyone know how to do this?
user2684452
  • 701
  • 2
  • 14
  • 31
5
votes
1 answer

Add Parsley.js validator with referenced field

I want to add a couple of checks for my forms whose condition is related to other fields' values (i.e. I have a range form and from field must be less than to field, and viceversa). I didn't find anything like that on the present Validators so I…
goffreder
  • 503
  • 3
  • 17
5
votes
2 answers

Erroneous placement of error message span with Parsley 2.x and Bootstrap 3

I'm trying to add Parsley validation to a set of radio buttons contained within a Bootstrap 3 btn-group. The issue is that the error wrapper that parsley injects (in my case set to a span) is appearing in between the two options (which are contained…
Jon
  • 377
  • 2
  • 11
5
votes
4 answers

Parsley validation not working Angular js

i am using parsely validation with angular js but its not working what i am doing wrong can any one correct or detect the mistake in my code. if i am submiting so its not working not showing me any error as parsely show , according to thier…
Wajihurrehman
  • 567
  • 3
  • 15
  • 29
4
votes
2 answers

parsley.js does not work for ckeditor textarea

I wrote code for my form with parsley.js validator, however it works fine except CKEditor textareas. Where can be the problem? Here is screenshot Here is my code: