Hi All,
I have a data field. In Object -> Valid patterns I changed the format as MM/DD/YYYY.
and i am writing the java script code on exit event of date field
var
reGoodDate = /^(?:(0[1-9]|1[012])[\/.](0[1-9]|[12][0-9]|3[01])[\/.](19|20)[0-9]{2})$/
;
if (reGoodDate.test(dt))
{
xfa.host.messageBox("Correct format")
}
else
{
xfa.host.messageBox("Incorrect Format");
}
but though i am giving the correct date formatt it is giving as error message
Views
Replies
Total Likes
Hi,
try these regular expression instead.
if (this.formattedValue.match(/^(0[1-9]|1[012])[-\/\.](0[1-9]|[12][0-9]|3[01])[-\/\.]((19|20)\d{2}|\d{2})$/g)) {
xfa.host.messageBox("Correct date");
} else {
xfa.host.messageBox("Wrong date");
}
Views
Replies
Total Likes
Hi,
Thank you its working .
Views
Replies
Total Likes