Solved

Set max amount of characters

Posted on 2011-09-14
11
535 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

929 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now