parsley.js

Parsley validation not working Angular js

亡梦爱人 提交于 2019-12-09 13:15:25
问题 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 attributes. I also add parsely libraries and not getting any error related to it so what's going wrong. LoginView.html <form class="form-horizontal" ng-submit='login()' data-validate="parsley"> <div class="modal-header"> <h3>Login</h3> </div> <div class=

Parsley.js remote validation response still validates to true after ParsleyUI.addError

最后都变了- 提交于 2019-12-08 03:51:07
问题 I have this form: <form method="post" id="myForm" data-parsley-validate> <input type="text" name="firstName" id="firstName" required> <input type="text" name="lastName" id="lastName" required> <input type="text" name="userName" id="userName" data-parsley-trigger="focusout" data-parsley-remote data-parsley-remote-options='{ "type": "POST" }' data-parsley-remote-validator='validateName' required> <input type="button" id="formSave" name="submit" value="Next"> </form> And script: var userName = $

Parsley.js Trigger Error on AJAX

荒凉一梦 提交于 2019-12-07 18:08:28
问题 I am using parsley.js for client-side validation. I have a field called username, which must be unique. The field looks like this: <input type="text" name="loginUsername" id="loginUsername" class="form-control" placeholder="Username" data-minlength="2" data-maxlength="40" data-required="true"> This is my ajax function: function validateField(field) { var isValid = $( '#'+field ).parsley( 'validate' ); if (!isValid) return false; return true; } $( '#regUsername' ).blur(function(){ if (

How to validate only selected fields using parsley js

自作多情 提交于 2019-12-06 14:17:44
问题 I'm using parsley js in two forms in a single page. i want to trigger parsley validator when i click on a type='button' field and validate the first form to check only 3 fields of the form. Initially there are around 7 fields in the form included for validation. So far I couldn't make it work. tried this but no luck. any idea? update: this is my code; <div class = 'two'> <input type='text' id='firstname' name='firstname' /> </div> $('#form').parsley({ excluded: '.two input' }); $('#form')

Parsley.js error message

非 Y 不嫁゛ 提交于 2019-12-06 08:57:10
问题 I am using parsley.js from http://parsleyjs.org/. Wanted to get the error message from the call back function (onFieldError) and place the value inside a twitter bootstrap popover. In order to do so, I'll need to place it inside the data-content attribute of the popover instead of a div. Can any one tell me how to do this or fix this. onFieldError: function ( elem, constraints, ParsleyField ) {} These are the only parameters that are available. 回答1: If you look in parsley.js source file, you

Parsley Form Validation - Event Listeners

我怕爱的太早我们不能终老 提交于 2019-12-06 08:46:32
问题 Ok, so i have searched everywhere for this but still can't get it working. No one seems to have tried it but i'm sure it can do it. I want to use the Parsley validation plugin with my twitter bootstrap project. I have read the docs, but am still learning JQuery so it's going right over my head (i'm rationalising that it is too advanced for me at the moment). I want to add a custom event listener to Parsley to show a popup on error instead of the ugly li's. This is what i have tried: JQUERY $

custom error display with parsley.js 2.x

Deadly 提交于 2019-12-06 05:48:23
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 far I inspected to have several properties: $element - the actual jQuery field, constraints - list of

Using Parsley.js with Meteor using HTML Code

允我心安 提交于 2019-12-06 02:05:54
I have been trying to use Parsley.js with Meteor, I can get it to work with a JS using a rendered function but I've had no luck when I use the HTML code approach. Example code is given below: <form class="form-horizontal frmParsley" role="form" parsley-validate> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label">Name</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputEmail3" placeholder="Name" parsley-trigger="change" parsley-minlength="5" required /> </div> </div> </form> Per the docs at http://parsleyjs.org/documentation.html

Parsley.js Trigger Error on AJAX

此生再无相见时 提交于 2019-12-05 20:22:55
I am using parsley.js for client-side validation. I have a field called username, which must be unique. The field looks like this: <input type="text" name="loginUsername" id="loginUsername" class="form-control" placeholder="Username" data-minlength="2" data-maxlength="40" data-required="true"> This is my ajax function: function validateField(field) { var isValid = $( '#'+field ).parsley( 'validate' ); if (!isValid) return false; return true; } $( '#regUsername' ).blur(function(){ if (!validateField('regUsername')) return false; var username = $(this).val(); $.post('<?= SITE_ROOT; ?>/ajax

How to use the parsley.js pattern tag?

我们两清 提交于 2019-12-05 12:44:17
问题 How do I add the attr:data-parsley-pattern="" tag correctly to a input? I wrote this: <input type="text" name="serialnr" id="serialnr" data-parsley-pattern="^[a-zA-Z]{4}[ -]?[a-zA-Z]{4}[ -]?[a-zA-Z]{4}[ -]?[a-zA-Z]{4}$"> But this does exactly nothing (No validation takes place at all while the other input are validated correctly). Do I have to add data-parsley-required="true" ? (Which I did but that didn't help). I tested the regex with https://www.debuggex.com/ so It shouldn't be a typo.