Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Entry restrictions in public UI

Quote Reply
Entry restrictions in public UI
New with this but as far as I can see, the public UI (for adding a link, for example) enforces database constraints but does not inform the user. For example, I set a field length to 80 characters. Entered over 100 in the public UI. It was accepted with no errors but clearly trimmed to 80 when saved in the database.

Did I miss something? And, if not, what is the "right way" to fix this?
Phil Hughes
Quote Reply
Re: [nicafyl] Entry restrictions in public UI In reply to
One way of triggering an error for such cases is to set a "Form Regex" on the column. For your example, you could use something like ^.{0,80}$

However, the problem with that method is that it doesn't give a very good error message (it says "x cannot contain the value 'y'").

Another way would be to write a plugin that handles the checking and returns a proper error.

Adrian