Hi,
How do I dynamically restrict the lenght of the field? I could not use the maxChars property as it cannot be directly addressed. Based on certain conditions I would like to dynamically retrict the field length to 2 characters. Can anybody help?
I am able to capture the length using the below code: -
var
maxLen = this.value.oneOfChild.maxChars;
but how do I restrict the length of the field to 4 characters only ?
Regards,
Shishir.P
Views
Replies
Total Likes
Something like this will work.
// form1.page1.subform1.productID::exit - (JavaScript, client)
if (form1.page1.subform1.productID.isNull) {
xfa.host.messageBox("The product ID is a mandatory field.");
}
else {
var productID = this.rawValue;
if (productID.length != 4) {
xfa.host.messageBox("The product ID must be four characters in length.");
}
}
This code assumes the product ID is a mandatory field.
Steve
Views
Replies
Total Likes