Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9248847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:02:48+00:00 2026-06-18T10:02:48+00:00

My Parsley error message on the first keyup event when typing into field #myTestField

  • 0

My Parsley error message on the first keyup event when typing into field #myTestFieldis

This value is too short. It should have 4 characters or more.

I tryed to change Parsley field data attributes on the fly, but it seems this doesn’t work. It keeps the value assigned in first place (html form) without taking in account the modified one in the JS code.

On Chrome I can check that the data attribute value is changed after the DOM is loaded.

My code is

<form name="myForm" id="myForm">
    <input type="text" name="myTestField" id="myTestField" data-trigger="keyup" data-minlength="4" data-validation-minlength="0" >
    <button id="mySubmitButton" type="submit" >Save</button>
</form>

<script>
// wait for the DOM to be loaded 
    $(document).ready(function() {
    // destroy
    $('#myForm').parsley('destroy');
    // change attribute
    $('#myTestField').attr('data-minlength','2');
    // assign parsley to do the job
    $('#myForm').parsley();
      });
</script>

I am doing something wrong?

UPDATE:

This is a known issue of Parsley.js and theres a Issue #52 on GitHub

I also tried to use removeItem() followed by addItem() on the same input #Id but didn’t work either.

I’m still trying to figure out a workaround

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:02:49+00:00Added an answer on June 18, 2026 at 10:02 am

    Parsley is based on data attributes, that are binded by jQuery with .data()

    Unfortunately, when you add a data- attr, it is not binded to jQuery .data(). You’ll have to add the validators this way on the fly:

    <script>
    // wait for the DOM to be loaded 
        $(document).ready(function() {
          // destroy
          $('#myForm').parsley('destroy');
          // change attribute
          $('#myTestField').data('minlength', 2);
          // assign parsley to do the job
          $('#myForm').parsley();
        });
    </script>
    

    I’ll add an API to add / edit / remove validators on the fly, without having to call destroy 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know already so many questions have been asked here on this error #2025
The first time my application loads, I get an error. If I immediately reload
This is a puzzler. Relevant Environment: Flex app, running parsley, which gets built by
I have Flex/Parsley/Blazeds application deployed on weblogic 9.x. The following error appears in the
I have a php code - --------- <div id=product1> <select name=product class=:required onchange=change1(this.value)> <option
I'm using Parsley in my flex mobile project. I have multiple destination services but
I am trying to use parsley framework in my flex application. Messaging System is
I am developing an application in Flex using the cairngorm module library and Parsley.
I was wondering if Parsley framework is compatible for Flex Hero Mobile 4.5? I
i'm looking for a possibility to log messages in my flex 4.5 Project. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.