Hi All,
In a textfield its should accept two conditions i.e.,
1) It should accept 10 digits or
2) In a field it should accept two chars and 5 digits. or than that its should pop up an alert.
I have tried setting patterns and worte the script in exit event:
if(this.rawValue == this.formattedValue)
{
xfa.host.setFocus(this.name);
}
But the setFocus is going again and again.
Patterns: text{AA99999}|text{9999999999}
Please help.
Thanks in advance
Regards,
Apurva
Views
Replies
Total Likes
Hi Apurva,
You need regular expression for this. Remove all the validations of the text field first i.e display,edit,validation,data.
In the exit event of the field put the following script.
var vPattern = /^([a-zA-Z]{2}[0-9]{5})$|^([0-9]{10})$/;
var result = vPattern.test(this.rawValue);
if (result == false)
{
xfa.host.setFocus(this.name);
}
Thanks,
Bibhu.
Views
Replies
Total Likes
Hi Bibhu,
Thank you so much for ur help.
Regards,
Apurva
Views
Replies
Total Likes