Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • chi 5 posts 25 karma points
    Oct 02, 2013 @ 13:10
    chi
    0

    Multi textbox in custom field type validation

    Hi

    I am using Contour 3..0.6 and have successfully created a custom field with multiple text boxes. I was also able to do some custom validation using the

    public override List

            var postcodeValidator = new PostCodeFieldValidator(_postCode, _street, _houseNumber, _town);
            var results = postcodeValidator.Validate();
            if (results.Any())
            {
                var exceptions = new List<Exception>();
                results.ForEach(x => exceptions.Add(new Exception(x)));
                {
                    validate = exceptions;
    
                }
                return exceptions;
            }
            return null;
        }
    

    However I would like to be able to ensure that for example if one of the textboxes is causing a validation error, how can i ensure that the specific box is highlighted and displays the error.

    I have checked the Modelstate returned but it uses the custom field type model id as a key.

    Any ideas please?

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Oct 03, 2013 @ 10:58
    Tim Geyssens
    0

    That's a difficult one, don't think it's possible atm

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies