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 9097141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:02:03+00:00 2026-06-17T00:02:03+00:00

I am using the client_side_validations gem with Rails 3.1.0. I have been trying to

  • 0

I am using the client_side_validations gem with Rails 3.1.0. I have been trying to use it to validate a hidden field that is set through a javascript widget. From what I have read on the gem’s github page, the gem deliberately does not validate hidden fields because the user could not correct these fields. I have unsuccessfully tried to override this behavior.

Is there a way to override this behavior for a particular field without modifying the client_side_validations code (other than the init stuff that gets generated when you install the gem)?.

The way I’ve done it now is by making a slight modification to the validateForm function in the gem. When it looks for the fields to validate it only grabs the elements that are visible:

form.find(':input:enabled:visible[data-validate]').each(function() 

So I changed that to this:

form.find(':input:enabled[data-validate]').each(function() 

This seems to work. Is there a better way?

I haven’t been able to re-validate the hidden field when the user corrects their mistakes.

  • 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-17T00:02:04+00:00Added an answer on June 17, 2026 at 12:02 am

    If you want to validate hidden fields that is how to do it

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

Sidebar

Related Questions

I'm trying to have client-side validation errors show up inline, using the client_side_validations gem
I'm trying to use client_side_validations gem, but have some problems. First, I have in
I am using client_side_validations gem to perform a form validation in rails 3. everything
I am using Rails 3.2.8 and the excellent client_side_validations gem and would also like
I have a old rails project that is using rails 3.0.9 and I am
I'm using the client_side_validations gem to validate a contact form. The gem displays error
I am trying to use the CLient Side Validation Gem in Rails. My forms
I have designed a webpage using HTML and client side validation using JavaScript.PHP for
I've got the client_side_validations gem working really great on my forms. I'm using Devise
I want to validate asp FileUpload Control using in asp.net. That should accept only

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.