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
30
votes
3 answers

Trigger parsley validation without submit form?

Given this code, it never works and always returns true whatsoever ?

Hoan Dang
  • 2,222
  • 5
  • 27
  • 36
19
votes
3 answers

html data- attributes in ember.js handlebars

I am trying to do something like this: {{input value=email type="text" data-type="email"}} In order to use parsley.js to validate my inputs. (I know email can use type="email") but this is just an example. But I am seeing that the data-type="email"…
Bradley Trager
  • 3,570
  • 3
  • 26
  • 33
18
votes
3 answers

Change the position of parsley-errors-list in parsleyjs

I am using parsleyjs.org to validate my forms. The plugin creates a ui.parsley-errors-list when an input has a validation error. The problem is that the .parsley-errors-list is being placed just after the form element's "input, textarea, radio…
Leo
  • 967
  • 2
  • 14
  • 37
18
votes
2 answers

Getting Parsley 2.x working with Bootstrap 3 correctly

I am using Twitter Bootstrap 3.1.1 with Parsley v2.0.0-rc3. I made it mostly work apart from classHandler option. I have HTML like this:
18
votes
3 answers

How can I dynamically add and remove form fields to be validated by Parsley.js?

I have a form ('#registrations') that I am validating with Parsley.js and so far it is working fine. However, I am trying to dynamically remove form fields and add new ones to Parsley validation, depending on what someone selects in a select drop…
Michael Lynch
  • 2,682
  • 3
  • 31
  • 59
18
votes
3 answers

Parsley custom error message doesn't work

I have the following input field:
Marc Rasmussen
  • 19,771
  • 79
  • 203
  • 364
16
votes
4 answers

Parsley.js - change error container

I want to alter the positioning of each error message. That is display the error message in the respective
. By using the documentation's code the the error msg is displayed before the element (input) and not displayed…
user379742
14
votes
1 answer

How to use the parsley.js pattern tag?

How do I add the attr:data-parsley-pattern="" tag correctly to a input? I wrote this: But this does exactly…
KSPR
  • 2,212
  • 4
  • 29
  • 46
13
votes
4 answers

Google ReCAPTCHA how to make required?

Does anyone know how to make the "Google ReCAPTCHA (v2)" be "required" in a form? I mean no form submission until recaptcha is filled-in? I use ParsleyJs in my form, but didnt find a way to make it work with divs...
serhio
  • 28,010
  • 62
  • 221
  • 374
12
votes
1 answer

Parsley.js - Validate optional input for only numbers

I have a form that has one optional input and 3 required input fields. For the optional input I have the below markup:
user3312508
  • 907
  • 4
  • 10
  • 25
12
votes
1 answer

How to get the parsley.js reset() method to reset the form

I am having hard time figuring out to get the parsley.js 2.0 reset() method to fire upon clicking the reset button. This is my reset button: I have setup a click…
M Khan
  • 225
  • 1
  • 4
  • 14
11
votes
6 answers

Parsley.js - Displaying Errors in a Specified Element

Using Parsley.js, is it possible to specify the element that should hold the error messages? I tried: $('#myForm').parsley({ errors: { container: { $('#errorMessages') } } }); But the error messages are still…
Alix Axel
  • 151,645
  • 95
  • 393
  • 500
10
votes
2 answers

Asynchronous form submission with parsley.js

I'm trying to create a form that is validated front end using Parsley.js and submitted asynchronously. The form is called #contactForm and the submit button is #sendData, the error comes when I hit submit on an empty or invalid form. I expect to see…
nobody
  • 125
  • 1
  • 1
  • 6
9
votes
7 answers

parsley js - conditional required if checkbox checked

Is there an easy way with parsleyjs to make a field required depending on another field? See my js fiddle here http://jsfiddle.net/marksteggles/wbhLq0t4/1/
Mark Steggles
  • 5,369
  • 8
  • 40
  • 50
9
votes
3 answers

Preventing form submission after validation by parsley.js

I have used parsley.js many times and have literally copied the code from my last use of parsley. However, every time I submit the form the page refreshes. preventDefault seems to work on my other pages and stops the page from refreshing but for…
morty
  • 119
  • 1
  • 1
  • 6
1
2 3
50 51