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

  • SEARCH
  • Home
  • 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 5976685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:15:49+00:00 2026-05-22T21:15:49+00:00

I am dynamically adding validation rules when a ‘save’ button is clicked – I

  • 0

I am dynamically adding validation rules when a ‘save’ button is clicked – I am doing this for a text input and a select element:

$(“#my-txt”).rules(“add”, { required:
true, messages: { required: “text
required”} });

$(“#my-ddl”).rules(“add”, { required:
true, messages: { required: “selection
required”} });

After I add the rules I am manually triggering validation (.valid()) then removing the rules by doing .rules("remove") on the elements. I do this because I want the errors to stay up until the user clicks ‘save’ again and validation is re-triggered.

This works fine and the errors are displayed correctly … BUT … while the error for the text input stays up no matter what, when I click on the drop down list the relevant error goes away (I can see display: none being injected in the span containing the error) independently of any selection (it goes away as soon as I click on the control, not when I tab off). I would expect the error for the drop down not to be hidden, same as the text input field.

The rule seems to be actually gone though, because if I go back and pick the default value on the select element (value=””) it doesn’t show the error message.

This has been puzzling me – I am trying to find a way to get both fields to work the same way.

Any help appreciated!

  • 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-05-22T21:15:50+00:00Added an answer on May 22, 2026 at 9:15 pm

    After looking at the jquery-validate API again, I see there’s no option to keep error shown and the difference in handling the display must be in the plugin code. Good luck fixing it. 🙂

    Another way to fix this would be to manually save what jquery-validate add to your DOM, have it removed and re-append it yourself.

    Finally, I prefer to see when my input is valid without having to reclick some buttons. Especially in the case of strange, complex password requirements.

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

Sidebar

Related Questions

I'm dynamically adding rows/fields in this code. I have a text field for the
I'm dynamically adding a custom user control to the page as per this post
With jquery, I'm dynamically adding rows. To do this, I'm copying the first of
I am dynamically adding text in a RichTextBox . How can I set Focus
I am dynamically adding input elements to a table with the id of inputDataElements
I am dynamically adding ImageViews to a RelativeLayout depending on user input. I have
Is this the correct syntax for dynamically adding a filter to a bottom toolbar
In this jQuery code , I am dynamically adding boxes to the canvas div
Is there something stopping this working, I'm dynamically adding a row to a table,
Possible Duplicate: Dynamically adding collapsible elements I've seen a few posts on this but

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.