Jump to content
Sign in to follow this  
Raybaudi

a REAL MaxLength

Recommended Posts

I can paste any length of text into that field.

Maybe change the script step to:

Set Field [ field; Left(field;10)

and change the trigger to OnObjectModify?

Share this post


Link to post
Share on other sites

Another way to approach this is to just disallow any key presses besides navigation keys after 10 characters have been entered.

I love script triggers they are definitely going to provide many different, interesting approaches to a problem

MaxLengthTest.zip

Share this post


Link to post
Share on other sites

Hi JesseSFR

your example suffers the same problem of mine: you can paste how many chars you want.

Share this post


Link to post
Share on other sites

[color:red]Everyone please remember that the event triggers are not data validation tools. They work only on a specific instance of a field on a specific layout.

If you need field validations, use the options in Manage Database....

Steven

Share this post


Link to post
Share on other sites

Maybe change the script step to:

Set Field [ field; Left(field;10)

and change the trigger to OnObjectModify

Yes, it seems a lot better...

just I changed the script to:

Set Field [ Left ( Get ( ActiveFieldContents ) ; 10 ) ]

So it can be used on every field I wish.

Share this post


Link to post
Share on other sites

[color:red]Everyone please remember that the event triggers are not data validation tools.

Hi Steven

that wasn't a validation use of triggers...

It was only a way to stop the user entering data into a field.

Share this post


Link to post
Share on other sites

that wasn't a validation use of triggers...

It was only a way to stop the user entering data into a field.

Same concept applies. If the field is elsewhere accessible, then the process does not work.

Steven

Share this post


Link to post
Share on other sites

Hmmm...

If the field is elsewhere accessible, I'll attach it the same trigger.

Share this post


Link to post
Share on other sites

... and an auto enter to truncate the input.

But Steven is absolutely right, the way triggers are implemented is ONLY about user interface, not about data integrity/security. There are many ways of working around a 'trigger protected field' (Set Field script step, new field object on layout, including adding it to a table view...)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.