Hello,
I have a field that is required. I have it set to required and I have the characters set to 6. I can still enter 1 number and there is no error. I need this field to validate that it has 6 characters. Can anyone help me with a script?
Solved! Go to Solution.
Views
Replies
Total Likes
you may also want to check for > 6 too, if you are saying they can only have 6 characters in the field. Validation pattern would ahve been just as good, but it's personal preference.
Views
Replies
Total Likes
Hi,
Having the following javascript in the exit event will warning the user and set the focus back to the field:
if (this.rawValue.length < 6)
{
app.alert("This field must have at least 6 digits");
xfa.host.setFocus(this);
}
You could also apply a validation pattern to the field with something like text{999999}
Views
Replies
Total Likes
Hello and thank you so much for your help. I was able to use:
if
(Speedtype.length < 6)then
Speedtype
=""
xfa.host.messageBox("This field must have at least 6 digits")
else
Speedtype
=Speedtype
endif
This worked for me well, I wouldn't have been able to find it without your help. Thanks so much
Views
Replies
Total Likes
you may also want to check for > 6 too, if you are saying they can only have 6 characters in the field. Validation pattern would ahve been just as good, but it's personal preference.
Views
Replies
Total Likes
Views
Replies
Total Likes
Ok so I got it to work using the validations. Much Much easier. no scripting needed but it is good to know both ways. Thanks both of you for all your help. i'm sure we will cross paths again.
Views
Replies
Total Likes
you can ignore my e-mailed solution then Glad to hear you got the validation to work!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies