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.
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
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?
Comment author was deleted
That's a difficult one, don't think it's possible atm
is working on a reply...