[0.8.2] "Validator" property vs. AllowBlank

  1. #1

    [0.8.2] "Validator" property vs. AllowBlank

    I'm not sure this is really a bug, and not just intended behavior, but I encountered this while trying to set up some custom validators.

    If you have a blank value in a textfield, the only property it checks is allowBlank. The validation function will return at that point, either true if allowBlank is true, or false (with appropriate error) if not.

    Unfortunately this makes it impossible to define a Validator (using the validator property on Field) to validate blank values.

    In my application, this was needed because I did not want to allow blank values in certain fields if a checkbox elsewhere was checked (standard "is this address same as that other address" scenario).

    Please note that I /did/ find a workaround by writing a js function on my checkbox that set/unset allowBlank on each control in my secondary address block, but that isn't the ideal scenario I'd wanted.
  2. #2
    As far as I know, there is no other way to do what you want. you should set AllowBlank property to True of False for each control that are related to your Checkbox whenever "Change" event of your Checkbox fired.

Similar Threads

  1. [CLOSED] Conflict on AllowBlank property in MultiCombo !!!
    By imaa in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Mar 13, 2012, 10:25 AM
  2. Crazy validator
    By CarWise in forum Bugs
    Replies: 1
    Last Post: Jan 10, 2011, 11:41 AM
  3. [CLOSED] Set AllowBlank Property with JavaScript
    By pdcase in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 21, 2010, 5:07 PM
  4. Tab and AllowBlank
    By snippher in forum Bugs
    Replies: 0
    Last Post: Mar 20, 2009, 11:12 AM
  5. Compare Validator
    By Rod in forum 1.x Help
    Replies: 0
    Last Post: Oct 30, 2008, 10:50 AM

Posting Permissions