Max length validation message not appearing when testing inline edit
Max length validation message not appearing when testing inline edit
I am setting up max string length validation and am encountering an unexpected message. Using this page as guidance, I applied this function.
"MaxLen(int max, ValidationOpts cfg=null) - Validate a string does not exceed a maximum length."
When I use this function and test it with an inline edit, I receive this message instead of the custom one: "Max 50 Chars".
This is my function.
.Field(new Field("FridayPlanning.SmallGroupNotes")
.SetFormatter(Format.IfEmpty(null))
.Validator(Validation.MaxLen(50,new ValidationOpts {Message="Max 50 Chars"}))
)
Am I using this function incorrectly?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The mystery deepens. It looks like I get that same system error when trying to edit any field because of a where condition I have:
When I take that out, everything else works... but I need that there for the users. So now the issue becomes: how can I have that where condition in place without interfering with the ability to update a field.
I worked out the problem. It's a case of two independent things being correct in isolation conflicting with eachother when brought together.
So if you're sending an array as a parameter in ajax, I discovered that before sending your ajax call, you need to first do some character replacements in the array. I had done this in the controller, but it appeared that it actually needs to be done on the client side.
I'm pasting this below in case you're using .NET MVC and have a similar case as mine.
Thanks for the updates. Good to hear you've got it working now.
Allan
@allan -- How do I mark my question as answered when I supplied the answer? The website is asking me to mark this question as answered.
I've just done it. I need to modify the software at some point to allow that!
Allan