Link to home
Start Free TrialLog in
Avatar of noad
noadFlag for United States of America

asked on

Set max amount of characters

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 User generated image User generated image
Avatar of jvaldes
jvaldes
Flag of United States of America image

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.
Avatar of noad

ASKER

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?
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
Avatar of noad

ASKER

Honestly...

Very new at this, I have no clue what you are talking about.
But thanks
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
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...
Avatar of noad

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of jvaldes
jvaldes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of noad

ASKER

Understand what you mean
No idea how up do it
Will look into it
Thank for all of tour help! :-)
Avatar of noad

ASKER

Very helpful
Very simp,e explanation
Avatar of noad

ASKER

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?