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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:14:32+00:00 2026-05-15T03:14:32+00:00

I would like to disable client side validation on certain fields in my user

  • 0

I would like to disable client side validation on certain fields in my user form. Currently I have two sets of fields that are displayed depending on the value of a previous drop down list. i.e. if the drop down list is set to value “A” 1 new field appears in the form. If the drop down list is set to value “B” 3 new fields appear in the form (mutually exclusive from the new form field when “A” is selected). Currently my Dojo client side validation fails because the fields that are not shown to the user (and thus no data can be inserted into those fields) fails to validate.

Currently I determined that I can set the “validate” attribute to return true like so:

<input type="text" id="companycity" name="companycity" class="textinput" value="<?php echo set_value('companycity'); ?>" style="<?php if(isset($errorData['companycity'])){echo $errorData['companycity'];} ?>"
            dojotype="dijit.form.ValidationTextBox"
            required="true" trim="true" validate='return true'"
            regexp="([a-zA-Z]{1,25})"
            invalidMessage="Invalid value.  Must be between 1 and 25 alphabetic characters long.">

This fixes my issue for hidden fields. However this now means that no validation is performed when this field becomes visible to the user (i.e. the validate attribute is still set to return true).

I have tried removing the validate property when a field is displayed to the user like so:

dijit.byId('companycode').attr('validate','');

This just set the attribute to nothing. This however gives errors in firebug saying validate method not found, so I take that to mean I did not remove this attribute correctly or removing this attribute is not the appropriate way to do this.

I have also looked at overriding the validator method here but this doesnt seem like what I want either. I do not want to have to rewrite all the validation methods in place of dojo’s.

I just want dojo not to validate if the field is not visible to the user. Thanks for any advice or help.

  • 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-15T03:14:32+00:00Added an answer on May 15, 2026 at 3:14 am

    I determined that I was doing this incorrectly. ‘validate’ and ‘validator’ are not appropriate attributes for the dojo ValidationTextBox. They both throw errors in Firebug of the form “this.validate is not a function”. So at first it looked like this was working for me in the sense it was no longer trying to validate fields, but this is only because errors were being throw.

    A better solution was to set the “required” attribute to false upon load.

    <input type="text" id="companycode" name="companycode" class="textinput" value="<?php echo set_value('companycode'); ?>" style="<?php if(isset($errorData['companycode'])){echo $errorData['companycode'];} ?>"
                dojotype="dijit.form.ValidationTextBox"
                required="false" trim="true" 
                regexp="(^[A-Za-z]{2}-[0-9]{5}$)"
                invalidMessage="Invalid value.  Must be a valid company code of the form EX-00000">
    

    Then when a field became visible, set the required attribute back to true.

    dijit.byId('companycode').required = true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 500k
  • Answers 500k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You should really name the tags Movie MovieCollection and Title… May 16, 2026 at 2:06 pm
  • Editorial Team
    Editorial Team added an answer There is AccessCheck function or tricks, but this information is… May 16, 2026 at 2:06 pm
  • Editorial Team
    Editorial Team added an answer I added a HasMany option to the override for my… May 16, 2026 at 2:06 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a button that I would like to disable when the form submits
I have done extensive client-side validation through the help from jQuery. Now come to
I have an ASP.NET linkbutton control on my form. I would like to use
I would like to disable the context menu that appears after a long tap
I have URLs with some special characters and i would like to replace them
I am working on a web application (J2EE) and I would like to know
I have a perl cgi script that's fairly resource intensive (takes about 2 seconds
I converted my whole site to XML/XSL and I would like to know all
I would like to know what is the best practice on separating the content
I have a page with a form where I'm trying to prevent duplicate submission,

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.