Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Jason Brock
    @derwydd
    Hello, I'm having a problem trying to get ValidatorJS working with a nested object. Using ValidatorJS with Redux-Form

    I've tried both methods:
    function rules(data){
    return {
    'test_id': 'required',
    'textbox_test1': 'required|max:15',
    'ach_limits.limit_1': required|max:500,
    'phone_test2': 'required|telephone',
    'password_test3': 'required',
    'password_test4': 'required|same:password_test3',
    'test_select': 'required'
    }
    }

    function rules(data){
    return {
    test_id: 'required',
    textbox_test1: 'required|max:15',
    ach_limits:{limit_1: required},
    phone_test2: 'required|telephone',
    password_test3: 'required',
    password_test4: 'required|same:password_test3',
    test_select: 'required'
    }
    }

    Jason Brock
    @derwydd
    I found that it is flattening the ach_limits:{limit_1:''} into ["ach_limits.limit_1"]
    So while I was testing, I pushed ach_limits:{limit_1:''} into validator.errors, and that works with Redux-form... It has to keep its nested structure. Is there a way to prevent this flattening?
    Jason Brock
    @derwydd
    NVM