FAQ Database Discussion Community


Display only one generic message instead of one per input

javascript,jquery,validation,parsley.js
Is there any way to display only one generic error message, at the bottom of the form, for ex. "Please check the required fields" instead of one message per input inside a Parsley form? I'm looking at the docs but I don't find any options for this....

Use more than one Parsley Field instance on 'parsley:field:success'?

javascript,jquery,parsley.js
I'm trying to remove a validation message on a form when two specific fields have been validated. I can do it when one field is successfully validated but how would I go about doing it when multiple fields (or perhaps even a group) have been validated? Below is what I'm...

Duplication of field error when using Parsley.js

javascript,parsley.js
I am trying to output a list of error messages to the console when a form input is not validated. I am using parsley.js. Here is the javascript I am using. This works, but I get a duplication of every error and I am unsure what is causing this? (document).ready(function()...

How handle decimal and thousands separators for numbers in Parsley.js?

parsley.js
I can see that Parsley.js handle English separators for numbers. When I use Parsley with Spanish numbers it doesn't work (example : 5,50 is not a valid number for Parsley and in my country comma is our decimal separator). Is there some config to change it?...

Is it possible to raise a parsley error on demand?

javascript,jquery,ajax,parsley.js
My app is using parsley for validation. No issues on the client side. What I am having an issue with is having parsley invalidate a field based on an AJAX response. I'm trying to validate a SSN. Technically, all 9's is a valid format for an SSN, but once it...

Validate multiple select inputs as a group - Parsley

jquery,plugins,parsley.js
I currently have three individual select boxes that gather a users date of birth. The fields are for the day, month and year and I'm using the Parsley validation plugin to validate each input individually. However, I'm looking to find a way to validate all three inputs as a group...

Remove Parsley-Rails error messages, Rails 4

ruby-on-rails,parsley.js
I am using fantastic gem "parsley-rails", it works just perfect for my application. But now I am facing problem of removing those error messages, because they change form layout. My html looks like this : <input data-parsley-minlength="3" data-show-errors="false" id="message_name" name="message[name]" placeholder="Kā Jūs sauc ?*" required="required" type="text" data-parsley-id="9402" class="parsley-error"><ul class="parsley-errors-list filled"...

Add a custom CSS class with parsley.js

javascript,jquery,html,css,parsley.js
Using ParsleyJS, I have some custom javascript to add/remove a CSS class to an icon based on if the input is valid. Everything works, except when a user enters one input successfully and tabs/goes to the next input. When that happens, the class is applied to the icon even though...

Parsley.js - one multi steps function for all forms

javascript,jquery,forms,parsley.js
I am trying to set-up the multi steps form validation using the Parsely.js validation plugin. I followed the documentation here: "http://parsleyjs.org/doc/examples/multisteps.html" - but the only problem is I am going to have few forms that will have multi steps across the site and on some pages there will be more...

parsley js - conditional required if checkbox checked

parsley.js
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/ <form data-parsley-validate="true"> <div class="form-group"> <label> <input name="request_signature" type="checkbox" />Require signature</label> <div class="request_signature_fields"> <textarea class="form-control required" name="signature_reason" rows="3"></textarea> </div> </div> <input class="btn btn-success"...

data-parsley-mincheck checks all checkboxes by default

ruby-on-rails,checkbox,parsley.js
I have Rails 4 and Parsley-Rails installed. My form has multiple checkboxes,user needs to check at least 3 to save form in database.. But my code don't work. It checks all checkboxes by default. My form: <%= form_for(@advertisement, :html => {"data-parsley-validate" => true,:multipart => true},remote: true, format: :json) do |f|...

Insert additional content into parsley error

javascript,jquery,validation,parsley.js
I would like my parsley JS validation errors to render like this: <span id="parsley-id-8333" class="form-error filled"> <span class="parsley-required"> <i class="fa fa-exclamation-triangle"></i> Error Message Goes Here </span> </span> How can I modify this function to append the <i> inside my errorTemplate? window.ParsleyConfig = { errorsWrapper: '<span class="form-error"></span>', errorTemplate: '<span></span>' }; ...

Special effect on parsley min check error message, Rails 4

javascript,ruby-on-rails,parsley.js
I am creating simple app with registration, that consists of multiple field types - string, text, check-boxes etc. I added parsley to display errors if any. That works great. But now I want to change color for heading when error happens - specially when parsley-min-check triggers it. My code: <div...

How to subscribe to an individual field using parsley.js?

jquery,parsley.js
I am trying to figure out a way to change css elements upon a field being succesfully validated (with parsley.js). Below is a response I was given, and I'm not understanding how to accomplish this. "A solution is to listen for the right events, either globally or by subscribing on...

Show JqueryUI tooltip based on parsley validation

javascript,jquery,validation,jquery-ui,parsley.js
I am having some trouble with getting the JQueryUI Tooltip Widget working with parsley validation. This is my code: $.listen('parsley:field:error', function (fieldInstance) { var messages = ParsleyUI.getErrorsMessages(fieldInstance); if(fieldInstance.$element.tooltip('instance') != undefined) { fieldInstance.$element.tooltip('destroy'); } fieldInstance.$element.tooltip({ items: fieldInstance.$element, content: messages, show: 'pulsate' }); fieldInstance.$element.tooltip('show'); }); My methology is: Check if a tooltip...

Parsley.js in Wordpress “undefined is not a function” And EqualTo Not Working

jquery,wordpress,parsley.js
I'm having issues with Parsley.js 2.0.6 in WordPress (Bones theme). jQuery(document).ready(function($){ $('#myForm').parsley(); // "undefined is not a function' }); Without making this call to parsley, required attributes still work (which is puzzling), but <input type="password" id="password" required /> <input type="password" id="confirm-password" required data-parsley-equalto="#password" /> does not. The required part works,...

Change fields back to valid after invalidated by parsley

javascript,jquery,css,parsley.js,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 FieldToBeValidated from being invalidated constanly, keyup is turned off. Once the 'requirement'...

How to override Parsley JS focus behavior

javascript,jquery,parsley.js
When a new user comes to the page and types in an email that already exists in the system, I would like to do the following: Show the error message. Show the arrow. Then move the focus(cursor) to the Password field. Using jQuery I'm able to move the focus to...

How to use ParsleyJS 2.* using javascript and not data attributes

javascript,jquery,parsley.js
Looking in the docs they only offer examples with data attributes, I need to write a different js file for a form and do something like: $('#myform').parsley(options); I want to know the available methods in options, and apply validators to inputs and then print custom messages. It is possible?...

Delay Parsley.js form submission

jquery,parsley.js
I need to be able to validate a form in Parsley on submit, but to delay the actual submission itself until some other (timed) action is completed. I tried this: $("#myform").on('submit', function(e){ e.preventDefault(); var form = $(this); form.parsley().validate(); if (form.parsley().isValid()){ // do something here... setTimeout(function() { form.submit(); }, 3000); }...

Validate Chosen Multi Selection with Parsley.js

javascript,jquery,drop-down-menu,jquery-plugins,parsley.js
I managed to get parsleyjs.org validate a "required" Chosen dropdown but I can't seem to be able to validate the Multi selection dropdown. I have tried to apply the max and min validation rules, that did not work. I have setup parsleyjs.org and Choosen on a test site here: http://loai.directory/test/test/blank.php...

How to avoid parsley.js to move form elements from horizontal to vertical?

jquery,parsley.js
I want parsley to keep the form's horizontal layout like the one below: without including parsley but whenever I include parsley into the form: <form name="example_form" data-parsley-validate> it changes to this: with parsley included How can i keep the original format? Thanks for your help!

How do I call a built-in parsley validator from javascript?

javascript,jquery,parsley.js
I'm using version parsley js, version 2.0.7. I would like to invoke a built-in parsley validator from a custom validator. For example I would like the attribute data-parsley-customtype="number" to behave exactly as data-parsley-type="numeric". Is there a way to invoke an already defined validator?...

Unable to validate the “floating numbers” with parsley validator

javascript,html5,twitter-bootstrap,parsley.js
I am using Parsley validator validating my JSP form. However I am having an issue when validating numbers. Please have a look at the below code. <form class="form-horizontal" method="post" action="" data-parsley-validate> <input id="textinput" name="salary" type="number" required class="form-control input-md" value=<c:out value="${designationInfo.salary}"/> > </form> The number field may contain the floating numbers,...

Parsley Config Error Messages

parsley.js
I'm trying to override the default error messages using windows.ParsleyConfig, but I have yet to find the correct syntax: window.ParsleyConfig = { messages: { defaultMessage: "This value seems to be invalid.", type: { number: "asdasd." } } }; I've tried a few variations of this, non of which has worked....

How to change CSS properties on success of each field with Parsley.js

javascript,jquery,parsley.js
I asked this question many months ago and it was never answered, but I would like to try again with more specific details. I'm using parsley.js and currently whenever a form field is validated, that field turns green, that's great. But what I'm trying to do is add a javascript...

Jquery parsley validate not working

javascript,php,jquery,ajax,parsley.js
if($("#dataform").parsley().isValid()){ $.ajax({ url : '<?php echo base_url();?>index.php/company/final_review?id=<?php echo $this->input->get('id'); ?>', type : 'POST', data : $("#dataform").serialize(), dataType:"json", beforeSend: function(){ $('#remarks').parsley( 'addConstraint', { minlength: 5 }); }, success : function(data){ console.log(data); } }); } This is my ajax part. The plugin is not validating the field it's submitting the form. The...

multiple custom error message support per field by using parsley.js

javascript,jquery,parsley.js
I am trying to validate a simple form using parsley.js and I am very beginner on parsley.js.I would like to show multiple error messages in one custom validation method using window.ParsleyValidator.addValidator() method.So I have tried out in my way. Simple html form I have created <html> <head>Custom Validation Parsley <script...

How access element attribute inside Parsley Validation

validation,parsley.js
I need get attributes of element inside Parsley validation, I can using jQuery and selector, but I think it not the best way, have another way to do it? See below my validation and html code: (function () { 'use strict'; // Validate xml extension. window.ParsleyValidator.addValidator('filetype', function (value, requirement) {...