Reputation: 2766
I added a new (text)field to a Lotus Notes form. The form is a part of an application template.
I need to set the maximum length of 75 characters for the field, but I can't find a "maxlength" property anywhere. I added the following piece of code to the "Input Validation":
@If(@Length(qasubjects) > 75; @Failure("The maximum length is 75 characters."); @Success)
The validation is not very user-friendly though, because the user will see this message only after clicking "Save". I need a max length restriction to this field.
I already tried adding MAXLENGTH=75 to the HTML attributes and "HTML tags" -> "Other" without success.
I'm using Lotus Domino Designer 8.5.2.
Upvotes: 1
Views: 4930
Reputation: 724
Possibly too late, but anyway ...
Have you tried putting your original formula in the field's OnChange event? Doing that should at least advance the message from the time that the user clicks save and up to when the user deselects the field...
I don't think you can make it so that you will be interrupted in your typing by a message saying "that's quite enough input, thank you". :-/
Upvotes: 1
Reputation: 22266
The MAXLENGTH attribute will only work if you are viewing this form in a browser, and only if the field type is a text field (I.e. not multiple rows)
On the Notes client side, the field validation is a typical way to handle this. Client side JavaScript should offer a way to validate as keys are pressed, if you want to prevent keyboard input after the 75th character. The event to handle is OnKeyDown - check for length and cancel input if beyond the limit.
Upvotes: 3
Reputation: 70369
From what I gather there is no "standard way" to do this...
There are some JavaScript-based approaches with more or less user-friendliness... perhaps one or a combination of these work for you:
Upvotes: 2