parsley.js

Parsley (2.8.1) unique username validation with php

笑着哭i 提交于 2019-12-11 16:43:16
问题 I read all the documentation of the Parsley Js web site. But i not get enough understand how to set custom validation depend on AJAX response. I need to validate a username and check if it is already exist in the database if it is yes and show the error when hit the submit button. I look around here and try to find any question regarding to this i could not fine that only i got how ajax code should place to validate that forms. I need to know how the PHP file look likes. That why i post that

Unable to display GIF while submitting form after parsley validation

会有一股神秘感。 提交于 2019-12-11 16:00:15
问题 I want to display GIF on form submitting after parsley is a success, so the condition is only after submitting form field and validation in the success I need to show gif only when the form is submitting I tried $(document).ready(function () { $('#adform').parsley({ trigger: 'change', successClass: "is-valid", errorClass: "is-invalid text-danger", errorsWrapper: '<div class="input-group"></div>', errorTemplate: '<small class="form-text text-danger"></small>', }); }) .submit('form:submit',

.submit() is always executed even when Parsley validation fails

旧巷老猫 提交于 2019-12-11 15:16:01
问题 I'm using parsley.js for validation. It does the job without using Ajax. But when I add a .submit() function, its always fired and does not wait for validation. UPDATE: I need to use remote validation too $(document).ready(function(){ $('#form_register').submit(function(){ alert('The form submitted'); }) }); https://jsfiddle.net/rostamiani/mzdvLpnt/3/ It works in fiddler but not in my page. The I attached my page: https://ufile.io/hm7w5 回答1: UPDATE This code does not work for remote

parsley.js custom validator - not equal to

孤街浪徒 提交于 2019-12-11 08:13:11
问题 Hi I'm using parsleyjs for my form validation. http://parsleyjs.org/documentation.html I want a custom validator so that an input value can not equal what I specify... An example using jQuery validation can be seen here... How to add a Not Equal To rule in jQuery.validation I'm thinking something like.. $( '#form' ).parsley( { validators: { notEqual: function ( val, ??? ) { return val != ??? ; } } , messages: { notEqual: "Please enter a valid value" } } ); Thanks 回答1: This worked for me. You

How do I change the error message “Please fill out this field?”

老子叫甜甜 提交于 2019-12-11 05:08:31
问题 I am having trouble to change this error message. I need the message to be displayed in french. <input type="text" name="name" id="name" size="30" class="text-input-big" placeholder="PRÉNOM" parsley-type="alphanum" parsley-error-message="Le prénom est requis" required /> I used this for my first field, but no matter what I do, or add, still can't see the message that I want to see. 回答1: Since you are using "alphanum" as type, you could use: <input type="text" name="name" id="name" size="30"

Remote validation for a field which depends on others

淺唱寂寞╮ 提交于 2019-12-11 02:49:35
问题 How can I get parsley to include more fields in its AJAX-Calls, so that I can test dependencies between these fields? Example: <form method="post" action="/myscript.php" data-parsley-validate> <input type="text" name="i1" data-parsley-group="g1" data-parsley-remote="/myvalidator.php" /> <input type="text" name="i2" data-parsley-group="g1" data-parsley-remote="/myvalidator.php" /> <button type="submit">Send</button> </form> Currently the $_POST -data only contains the field being validated,

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

老子叫甜甜 提交于 2019-12-10 18:07:14
问题 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 src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script src="js/parsley.min.js"></script> <script src="js/my-validator-parsley.js"></script> </head> <body

Parsley.js date validation in v2.x

ぃ、小莉子 提交于 2019-12-10 16:45:28
问题 Is it possible to use the date validation in Parsley v2.X as in the previous version? Example (v1.x): parsley-onorafterdate="#currentDate" I cannot find information in the documention about this issue. 回答1: I believe for any validators outside of the documented core validators you will need to either copy a pre-built validator or make your own. To add additional validators you will simply need to add the validator to a window config variable before you include parsley. They have an example

Add custom multiple validations with Parsley

僤鯓⒐⒋嵵緔 提交于 2019-12-10 13:48:23
问题 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 <form> or a section as a whole and provide an error at that level instead of at the <input> level. For example, imagine a form with a <table> that allows the user to enter different combinations of Color and Size. Say I want to validate there are no duplicate combinations. The optimal way would be to validate row per row and look for

custom error display with parsley.js 2.x

被刻印的时光 ゝ 提交于 2019-12-10 10:43:17
问题 I need to show a list of validation errors in a popup. I've disabled UI modification with <form data-parsley-ui-enabled="false"... and subscribed to the "parsley:field:error" event, where I collect error information, and then on "parsley:form:validated" I display the popup, ofcourse only on the condition isValid() == false . But I am having problems with getting the actual error message in the "parsley:field:error" handler. The handler gets a single parameter containing an object, which so