parsley.js

Parsley custom error message doesn't work

情到浓时终转凉″ 提交于 2019-12-03 23:59:22
I have the following input field: <input id="name" name="real_name" type="text" placeholder="ie. Your full name or company name" class="form-control input-lg parsley-validated" data-required="true" parsley-error-message="Please insert your name" > However, when I press my submit button, I only get the standard This value is required. message. Can anyone tell me why? Try this attribute instead of 'parsley-error-message': data-required-message="Please insert your name" It's not a custom error message for custom validator. You need to override the default 'required' error message with your one.

How to use the parsley.js pattern tag?

孤者浪人 提交于 2019-12-03 23:35:54
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. What do I miss? I call parsley only via data-attributes. Does that matter maybe? Thank you. Your code

Getting Parsley 2.x working with Bootstrap 3 correctly

孤者浪人 提交于 2019-12-03 22:42:57
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: <div class="form-group"> <label class="control-label" for="username">User Name</label> <input class="form-control" id="username" name="username" required="" type="text" value=""> </div> And run Parsley like this: $("#register_form").parsley({ successClass: "has-success", errorClass: "has-error", classHandler: function(el) { return $(el).closest(".form-group"); }, errorsWrapper: "<span class='help-block'></span>", errorTemplate: "<span></span>" }); Everything

Parsley.js - Display errors near fields AND in a combined list above form

匆匆过客 提交于 2019-12-03 08:28:54
Is it possible to configure Parsley.js to display its error messages both... a) next to individual fields, AND b) in a combined list elsewhere on the page ...at the same time? Also, is it possible to render error messages with a hyperlink back to the field that generated the error? Thanks. UPDATE: The accepted answer is a fantastic example (thanks milz!) but it needed a bit more refining. For the benefit of other readers, here's my updated code in which... Error messages no longer duplicate after failing first validation (in original example, try generating an error then repeatedly pressing

Using an input=“submit” field to submit instead of button=“” with parsley.js

喜欢而已 提交于 2019-12-02 20:13:47
问题 I currently have an ASP.net page which has one form tag around the entire page. Within that page, I have two forms that are validated with parsley.js when their respective submit button is clicked. At the moment, the trigger to validate these forms are buttons and I need for them to be input="submit". Does anyone have an idea on how to execute this? Here's a JS fiddle example - http://jsfiddle.net/ukgvam9k/26/ <form method='post' id='form'> <div class="first"> <input type='text' id='firstname

Validate max file upload size with parsley.js

戏子无情 提交于 2019-12-02 19:30:57
问题 I'm using parsley.js in a USP Pro form in Wordpress. The validation works, in general, but now I'm trying to validate the max file size and I don't really understand how to do it. I've found these instructions, but couldn't manage to make it work. Here's my code: <input type="file" data-parsley-error-message="This field is required" required="required" placeholder="File(s)" name="usp-files[]" multiple="multiple" data-filemaxsize="1.5" maxlength="255" class="file-input usp-input usp-input

Validate max file upload size with parsley.js

风流意气都作罢 提交于 2019-12-02 13:38:44
I'm using parsley.js in a USP Pro form in Wordpress. The validation works, in general, but now I'm trying to validate the max file size and I don't really understand how to do it. I've found these instructions , but couldn't manage to make it work. Here's my code: <input type="file" data-parsley-error-message="This field is required" required="required" placeholder="File(s)" name="usp-files[]" multiple="multiple" data-filemaxsize="1.5" maxlength="255" class="file-input usp-input usp-input-files usp-clone" id="usp-multiple-files" data-parsley-id="3077"> window.ParsleyConfig = { validators: {

Using an input=“submit” field to submit instead of button=“” with parsley.js

喜你入骨 提交于 2019-12-02 10:38:50
I currently have an ASP.net page which has one form tag around the entire page. Within that page, I have two forms that are validated with parsley.js when their respective submit button is clicked. At the moment, the trigger to validate these forms are buttons and I need for them to be input="submit". Does anyone have an idea on how to execute this? Here's a JS fiddle example - http://jsfiddle.net/ukgvam9k/26/ <form method='post' id='form'> <div class="first"> <input type='text' id='firstname' name='firstname' data-parsley-group="first" required /> <input type='text' id='lastname' name=

Use parsley.js for certain areas of a form?

余生长醉 提交于 2019-12-02 06:50:39
问题 I'm using parsley.js (parsleyjs.org) in combination with acc-wizard.js (http://sathomas.me/acc-wizard/). Is there a way to make parsley check only a certain region (see following code, e.g. region one , which could contain 5 input fields) instead of the whole form? <form> <div id="one">fields for parsley.js to validate...</div> <div id="two">fields for parsley.js to validate...</div> <div id="three">fields for parsley.js to validate...</div> </form> Thanks! 回答1: You can initiate Parsley via

Use parsley.js for certain areas of a form?

自作多情 提交于 2019-12-02 00:37:59
I'm using parsley.js (parsleyjs.org) in combination with acc-wizard.js ( http://sathomas.me/acc-wizard/ ). Is there a way to make parsley check only a certain region (see following code, e.g. region one , which could contain 5 input fields) instead of the whole form? <form> <div id="one">fields for parsley.js to validate...</div> <div id="two">fields for parsley.js to validate...</div> <div id="three">fields for parsley.js to validate...</div> </form> Thanks! You can initiate Parsley via JavaScript so that you can pass in custom options. Then you can just use the excluded param to remove