Solved

Set max amount of characters

Posted on 2011-09-14
11
541 Views
Last Modified: 2012-05-12
I like to be able to set a max number of characters on a txt field.
I tried and it still continue to allow me to enter more characters field setup txt field
0
Comment
Question by:noad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 9

Expert Comment

by:jvaldes
ID: 36541327
The choice you made will generate an error but you have to trap the error in order to provide feedback to your user. If you want to notify the user of the error put a check in the validation criteria, ,"Display custom message if validation fails" the message that you put in the box will be displayed in a dialog if the user exceeds the character count. In order to provide as you type feedback you will have to write a custom function that you trigger every character that is entered where you compute the length of the entry so far and provide the user a dialog if he exceeds the limit.
0
 
LVL 1

Author Comment

by:noad
ID: 36542000
OK,

I'm doing it all wrong, I just want to be able to  allow only a fix number of characters in a note field. In other words when  you start to type in the notes field, I only want the user to be able to type in a max of 500 characters. How can I do that?
0
 
LVL 9

Expert Comment

by:jvaldes
ID: 36542262
Use a script trigger like 'OnObjectkeystroke" to trigger a script like the one below. This is just conceptual. you need to do the coding for the handling and clearing of the value of $$number and some other coding to make it do what you may want but this should give you enough direction to get you going...
character-count.tiff
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:noad
ID: 36557250
Honestly...

Very new at this, I have no clue what you are talking about.
But thanks
0
 
LVL 9

Expert Comment

by:jvaldes
ID: 36558052
Script triggers are triggers you can attach to a field, note that if you right click a field you will see an item on the drop down called script triggers, if you choose that you can select the kind of trigger you want to use to trigger the script and then you can create a script that does what you want  and I have sent you....

Ask anything else you want
0
 
LVL 9

Expert Comment

by:jvaldes
ID: 36558059
By choosing a script trigger that triggers every key you can create a script that will stop you as you are typing, If you choose a script trigger that triggers when you exit a field you can write a script that tells the user there are too many keystrokes in the field...
0
 
LVL 1

Author Comment

by:noad
ID: 36559205
Ahhhhh....

I get it!
OK,
I did what you said and it works!, but when I delete or create another record as soon as I start to type it comes up with the message I gave it " you have reached your Character Limit.
So my concern is, if while someone is type they reach the limit an want to delete to rewrite, the message will still come up or when a new record is created the same message will continue to come up.
Can this be fixed?
0
 
LVL 9

Accepted Solution

by:
jvaldes earned 500 total points
ID: 36560699
Put in a script that clears the count when you exit the field, using the field exit script trigger or check for a backspace keystroke and decrement the counter...
0
 
LVL 1

Author Comment

by:noad
ID: 36561998
Understand what you mean
No idea how up do it
Will look into it
Thank for all of tour help! :-)
0
 
LVL 1

Author Closing Comment

by:noad
ID: 36565803
Very helpful
Very simp,e explanation
0
 
LVL 1

Author Comment

by:noad
ID: 36566931
jvaldes

I have no idea on how to make it reset if I try to delete characters that are already typed in.
Can you help me with this?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question